I have an input that is using jQuery UI datepicker, upon selecting a date the datepicker closes and then i make an ajax call to get some data back and refresh a datagrid.
Somehow, after the datagrid finishes refreshing the datepicker auto open's. I'm presuming the input never lost focus and there for the datepicker triggers. This only happens in chrome. Is there a way to stop this from happening ?
I've tried forcing .blur() upon closing the datepicker, but that didn't work
$(".datePickerEnable").datepicker({
dateFormat:"dd-mm-yy",
changeMonth: true,
changeYear: true,
dayNames: [ "Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sabado" ],
dayNamesMin: [ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" ],
monthNames: [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ],
onClose: function() {
this.blur();
}
})
Doing document.activeElement
after the datagrid refresh shows that the input is still focused.