Skip to content

Commit 06cc0d0

Browse files
Markus DoitsMarkus Doits
authored andcommitted
Fix IE JS Error if first item is disabled
If the first item is disabled, it cannot be focused. This raises a JS error in IE8 (and probably other versions). Make sure we find the first item that is not disabled and focus this.
1 parent 4ff6048 commit 06cc0d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.multiselect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@
574574
// select the first option
575575
// triggering both mouseover and mouseover because 1.4.2+ has a bug where triggering mouseover
576576
// will actually trigger mouseenter. the mouseenter trigger is there for when it's eventually fixed
577-
this.labels.eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus');
577+
this.labels.filter(':not(.ui-state-disabled)').eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus');
578578

579579
button.addClass('ui-state-active');
580580
this._isOpen = true;

0 commit comments

Comments
 (0)