Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#6329 closed bug (duplicate)

hover, mouseenter, mouseleave do not behave as expected when entering from or exiting to a textarea or text input.

Reported by: eternicode Owned by:
Priority: low Milestone: 1.5.1
Component: event Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description

Functions attached to a subject via the mouseenter and mouseleave functions (or alternatively the hover function) are not triggered if:

  • the mouse, on leaving the subject, enters a textarea or text input
  • the mouse, on entering the subject, has left a textarea or text input

I first noticed this while using version 1.3.2, but it seems to happen with 1.4.2 as well.

In the attached file, hovering from the page to the div and vice-versa expand and shrink the div as expected. However, if you hover from the page to the div, then from the div to the textarea (or to the input), the div will not shrink as expected. It is the same for hovering in from the textarea/input then hovering out to the page.

Attachments (1)

jquery_issue.html (1.4 KB) - added by eternicode 10 years ago.
Self-contained HTML file that demonstrates a bug with hover (mouseenter / mouseleave)

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by eternicode

Attachment: jquery_issue.html added

Self-contained HTML file that demonstrates a bug with hover (mouseenter / mouseleave)

comment:1 Changed 9 years ago by Rick Waldron

Priority: low
Resolution: worksforme
Status: newclosed

This behavior no longer exists.

http://jsfiddle.net/rwaldron/7sSJr/1/

comment:2 Changed 9 years ago by anonymous

still exists for chrome 10.0.612

comment:3 in reply to:  2 Changed 9 years ago by jitter

Replying to anonymous:

still exists for chrome 10.0.612

The current stable version is 8.0.552.224 so if this behavior reappeared with a bleeding edge development version report on the chrome bug tracker

comment:4 Changed 9 years ago by ajpiano

#7828 is a duplicate of this ticket.

comment:5 Changed 9 years ago by ajpiano

comment:6 Changed 9 years ago by james@…

I'm seeing this behaviour with the current stable version of Chrome (9.0.597.84). A hover event handler is present on a parent div element to a text input element. Hovering the parent div triggers the event correctly, this is then cleared when entering the child input element.

http://jsfiddle.net/sY9HJ/

Works in IE 8, F 3.5, not in Chrome. It seems that the event isn't being passed up the chain - or something. I have no idea whether this is a fault in Chrome or JQuery, it would be great to get some expert eyes on it.

comment:7 Changed 9 years ago by Rick Waldron

By omitting a second hover function, jQuery will re-execute the first hover function "on hover out". So if the first function toggle's a class, the second will too.

Take a look at this:

http://jsfiddle.net/rwaldron/u8uBK/

comment:8 Changed 9 years ago by anonymous

@rwaldron: thanks for your reply. You're correct; I understand this. I'm using the toggle deliberately to add the class on enter and remove it when leaving. I could have used addClass() and removeClass() in the in/out handlers to be more specific. This displays the same, buggy, behaviour though.

I've updated the fiddle to include a workaround that keeps the input visible, as well as the demonstration of the behaviour.

http://jsfiddle.net/sY9HJ/9/

I'm not sure if this is a JQuery thing or if Chrome is not bubbling the event to the parent for some reason.

comment:9 Changed 9 years ago by jitter

Keywords: browser-bug added; hover mouseenter mouseleave removed
Milestone: 1.4.31.5.1
Resolution: worksforme
Status: closedreopened
Version: 1.4.21.5

comment:10 Changed 9 years ago by jitter

Keywords: browser-bug removed
Resolution: duplicate
Status: reopenedclosed

comment:11 Changed 9 years ago by jitter

Duplicate of #8209.

Note: See TracTickets for help on using tickets.