Jquery Ui Datepicker month/year dropdown is not working in popup in latest firefox

前端 未结 7 1017
萌比男神i
萌比男神i 2020-12-29 07:30

Somehow my jQuery UI Datepicker Month/Year Dropdown not working in any popup in latest firefox .

When I click on Month or Year Dropdown, the options list doesn\'t ap

7条回答
  •  星月不相逢
    2020-12-29 07:51

    I had to use

    $.fn.modal.Constructor.prototype.enforceFocus = function () {
    $(document)
      .off('focusin.bs.modal') // guard against infinite focus loop
      .on('focusin.bs.modal', $.proxy(function (e) {
        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
          this.$element.focus()
        }
      }, this))
    }
    

    in order to restrict focus inside model when we use Tab to focus elements (Got from GIT).

    tried this>>

    $("#dateOfBirth").datepicker({
        beforeShow: function(input, inst) {
            $(document).off('focusin.bs.modal');
        },
        onClose:function(){
            $(document).on('focusin.bs.modal');
        },
        changeYear: true,
        yearRange : '-150:+0'
    });
    

    Now I can select the year :)

提交回复
热议问题