Skip to content

Commit 3585502

Browse files
committed
Fix for the https://surveyjs.answerdesk.io/ticket/details/T1310 - jquery-ui-datepicker not closing automatically once date is selected in IE
1 parent 366b4c3 commit 3585502

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/jquery-ui-datepicker.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,20 @@ function init(Survey, $) {
5252
if (config.onSelect === undefined) {
5353
config.onSelect = function(dateText) {
5454
question.value = dateText;
55+
this.fixFocusIE = true;
5556
};
5657
}
58+
config.fixFocusIE = false;
59+
config.onClose = function(dateText, inst) {
60+
this.fixFocusIE = true;
61+
};
62+
config.beforeShow = function(input, inst) {
63+
var result = !!navigator.userAgent.match(/Trident\/7\./)
64+
? !this.fixFocusIE
65+
: true;
66+
this.fixFocusIE = false;
67+
return result;
68+
};
5769
var pickerWidget = $el.datepicker(config);
5870

5971
$el.keyup(function(e) {

0 commit comments

Comments
 (0)