Skip to content

Commit 0499854

Browse files
committed
IE11 Unspecified Error
Hi @trentrichardson, When calling setSelectionRange on an input element which is currently not visible, you get an unspecified error in IE11. I added a little check for this. Fixes trentrichardson#848
1 parent b8a8240 commit 0499854

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery-ui-timepicker-addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@
888888
else {
889889
this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
890890
}
891-
if (this.$timeObj[0].setSelectionRange) {
891+
if (this.$timeObj[0].setSelectionRange && this.$timeObj.is(":visible")) {
892892
var sPos = this.$timeObj[0].selectionStart;
893893
var ePos = this.$timeObj[0].selectionEnd;
894894
this.$timeObj[0].setSelectionRange(sPos, ePos);

0 commit comments

Comments
 (0)