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)) }
to limit focus inside the model when we use Tab to focus elements (derived 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 choose the year :)
ShAkKiR
source share