Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11382 closed bug (fixed)

Mouseenter doesn't fire on a disabled input element

Reported by: dmethvin Owned by: dmethvin
Priority: low Milestone: 1.8
Component: event Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

This was done intentionally in jQuery.event.dispatch based on #6911 to normalize a cross-browser behavior. However it seems inadvisable for us to do it, at least for some set of events. We can easily revert the change but it will cause other bug reports.

Test case: http://jsfiddle.net/pm4JG/6/

Change History (7)

comment:1 Changed 11 years ago by dmethvin

Component: unfiledevent
Milestone: None1.next
Priority: undecidedlow
Status: newopen

comment:2 Changed 11 years ago by dmethvin

I am thinking we may want to ban only click events with the idea that those are the most common events that should not appear on a disabled elements. The browser should never generate focus or blur on a disabled element so we shouldn't need to worry about them. Custom events or ones like mouseover would still occur, as would a program-created focus event because heaven forbid we should ever fail to fire a focus handler for an element that can't possibly receive focus.

comment:3 Changed 11 years ago by mikelehen@…

Relatedly (I assume), this breaks mouseenter / mouseleave event delegation. I'm trying to handle them on the *parent* of a disabled input control, but they don't always fire. This seems like a definite bug. Repros in Chrome and Firefox.

http://jsfiddle.net/u5HqK/2/

comment:4 Changed 11 years ago by dmethvin

Milestone: 1.next1.8
Owner: set to dmethvin
Status: openassigned

comment:5 Changed 11 years ago by jmarston

Firefox and Chrome don't appear to raise any mouse events for disabled inputs or buttons. Which means only banning click events would reintroduce inconsistencies between browsers for events like mouseover

comment:6 Changed 11 years ago by dmethvin

#11793 is a duplicate of this ticket.

comment:7 Changed 11 years ago by Dave Methvin

Resolution: fixed
Status: assignedclosed

Fix #11382. #11764. Only prevent click events on disabled elements.

We don't want a disabled link/button to register delegated clicks, but we do want events like mouseover or custom events.

This is a compromise, there is no perfect solution. Well, the browsers could be consistent about direct vs. delegated events but *that's* not gonna happen.

Changeset: 8a01c9201abb3a5311d5b0019b0322de89df6374

Note: See TracTickets for help on using tickets.