Avoid reopen datepicker after select a date
datepicker, internet-explorer, javascript, jquery, jquery-ui
Solution
This is the best workaround i can get:
(inspired from this link)
jsFiddle
$('#datepicker').datepicker({
/* fix buggy IE focus functionality */
fixFocusIE: false,
onSelect: function(dateText, inst) {
this.fixFocusIE = true;
$(this).change().focus();
},
onClose: function(dateText, inst) {
this.fixFocusIE = true;
this.focus();
},
beforeShow: function(input, inst) {
var result = $.browser.msie ? !this.fixFocusIE : true;
this.fixFocusIE = false;
return result;
}
}).click(function(){$(this).focus()});
Please note as you suggested in your question, im using jquery-UI 1.9.0. In your sample, you were using jquery-ui 1.8.15 which is known to be buggy on some events (e.g beforeShow() on IE).
Problem
Only in IE with this code ``` $('#datepicker').datepicker({ onSelect : function(x, u){ $(this).focus(); } }); ``` when I select a date, the datepicker reopen itself because I added `$(this).focus();` in `onSelect`. How I can to resolve this issue? (Example) I'm using jquery 1.8.2 and jquery-ui 1.9