JQuery UI Datepicker loses focus when selecting date with mouse

后端 未结 10 1549
情歌与酒
情歌与酒 2021-02-01 02:16

I am using JQuery ui with datepicker and when a user tabs on to a field, they appropriately get the calendar pop up.

  1. User tabs (via key onto field
  2. User s
10条回答
  •  无人及你
    2021-02-01 02:40

    You can probably use the onClose event to return focus to your input when the datepicker closes, as this refers to the associated input field in that callback. For example:

    $('.date').datepicker({
       onClose: function() { this.focus(); }
    });
    

提交回复
热议问题