Skip to content

Commit 7f812f8

Browse files
committed
Mouse: Work around a bug in IE 8 where disabled inputs don't have a nodeName. Fixes #7620 - Mouse: Error in IE 8 with disabled inputs.
1 parent e827a0e commit 7f812f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/jquery.ui.mouse.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ $.widget("ui.mouse", {
5959

6060
var self = this,
6161
btnIsLeft = (event.which == 1),
62-
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).closest(this.options.cancel).length : false);
62+
// event.target.nodeName works around a bug in IE 8 with
63+
// disabled inputs (#7620)
64+
elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
6365
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
6466
return true;
6567
}

0 commit comments

Comments
 (0)