Skip to main content

Bug Tracker

Side navigation

#11382 closed bug (fixed)

Opened February 23, 2012 08:30PM UTC

Closed June 27, 2012 04:12PM UTC

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:

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:

Attachments (0)
Change History (7)

Changed February 23, 2012 08:31PM UTC by dmethvin comment:1

component: unfiledevent
priority: undecidedlow
status: newopen

Changed March 03, 2012 10:36PM UTC by dmethvin comment:2

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.

Changed March 26, 2012 09:56PM UTC by comment:3

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.

Changed May 14, 2012 03:17PM UTC by dmethvin comment:4

milestone: 1.next1.8
owner: → dmethvin
status: openassigned

Changed May 14, 2012 04:29PM UTC by jmarston comment:5

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

Changed May 21, 2012 03:44PM UTC by dmethvin comment:6

#11793 is a duplicate of this ticket.

Changed June 27, 2012 04:12PM UTC by Dave Methvin comment:7

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