Skip to main content

Bug Tracker

Side navigation

#11731 closed enhancement (fixed)

Opened May 08, 2012 07:14PM UTC

Closed May 21, 2012 03:21AM UTC

Last modified January 22, 2013 06:26AM UTC

Deprecate "hover" pseudo-event

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

When the event name "hover" is used, the event subsystem converts it to "mouseenter mouseleave" in the event string. This is annoying for several reasons:

  • Semantics: Hovering is not the same as the mouse entering and leaving an element, it implies some amount of deceleration or delay before firing.
  • Event name: The event.type returned by the attached handler is not hover, but either mouseenter or mouseleave. No other event does this.
  • Co-opting the "hover" name: It is not possible to attach an event with the name "hover" and fire it using .trigger("hover").

The docs already call this name "strongly discouraged for new code", I'd like to deprecate it officially for 1.8 and eventually remove it.

Attachments (0)
Change History (4)

Changed May 08, 2012 07:32PM UTC by dmethvin comment:1

component: unfiledevent
milestone: None1.8
priority: undecidedlow
status: newopen
type: bugenhancement

Changed May 21, 2012 03:21AM UTC by dmethvin comment:2

resolution: → fixed
status: openclosed

Docs updated.

Changed January 22, 2013 06:08AM UTC by jquery@plungjan.name comment:3

I cannot find any documentation that hover is actually deprecated.

Any chance of updating http://api.jquery.com/hover/ and perhaps http://api.jquery.com/category/deprecated/

Changed January 22, 2013 06:26AM UTC by jquery@plungjan.name comment:4

Ah! My bad, [.on("hover"...)](http://api.jquery.com/on/#additional-notes) is deprecated, not .hover()

Replying to [comment:3 jquery@…]:

I cannot find any documentation that hover is actually deprecated. Any chance of updating http://api.jquery.com/hover/ and perhaps http://api.jquery.com/category/deprecated/