Skip to content

Commit c5799b5

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.
(cherry picked from commit 7f812f8)
1 parent 3e98e73 commit c5799b5

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
@@ -58,7 +58,9 @@ $.widget("ui.mouse", {
5858

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

0 commit comments

Comments
 (0)