Bug Tracker

Opened 5 years ago

Closed 5 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:


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 5 years ago by dmethvin

  • Component changed from unfiled to event
  • Milestone changed from None to 1.next
  • Priority changed from undecided to low
  • Status changed from new to open

comment:2 Changed 5 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 5 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.


comment:4 Changed 5 years ago by dmethvin

  • Milestone changed from 1.next to 1.8
  • Owner set to dmethvin
  • Status changed from open to assigned

comment:5 Changed 5 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 5 years ago by dmethvin

#11793 is a duplicate of this ticket.

comment:7 Changed 5 years ago by Dave Methvin

  • Resolution set to fixed
  • Status changed from assigned to closed

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.