Ticket #11731 (closed enhancement: fixed)
Deprecate "hover" pseudo-event
| Reported by: | dmethvin | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.8 |
| Component: | event | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
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.
Change History
comment:1 Changed 14 months ago by dmethvin
- Priority changed from undecided to low
- Status changed from new to open
- Type changed from bug to enhancement
- Component changed from unfiled to event
- Milestone changed from None to 1.8
comment:2 Changed 13 months ago by dmethvin
- Status changed from open to closed
- Resolution set to fixed
Docs updated.
comment:3 follow-up: ↓ 4 Changed 5 months ago by 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/
comment:4 in reply to: ↑ 3 Changed 5 months ago by jquery@…
Ah! My bad, [.on("hover"...)]( http://api.jquery.com/on/#additional-notes) is deprecated, not .hover()
Replying to 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/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
