Skip to main content

Bug Tracker

Side navigation

#6329 closed bug (duplicate)

Opened March 21, 2010 07:18PM UTC

Closed February 08, 2011 03:40PM UTC

Last modified March 14, 2012 01:27AM UTC

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 March 21, 2010 07:19PM UTC.

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

Change History (11)

Changed October 25, 2010 08:28PM UTC by rwaldron comment:1

priority: → low
resolution: → worksforme
status: newclosed

This behavior no longer exists.

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

Changed December 21, 2010 06:05PM UTC by anonymous comment:2

still exists for chrome 10.0.612

Changed December 22, 2010 12:56AM UTC by jitter comment:3

Replying to [comment:2 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

Changed December 22, 2010 08:52AM UTC by ajpiano comment:4

#7828 is a duplicate of this ticket.

Changed December 22, 2010 08:55AM UTC by ajpiano comment:5

Changed February 07, 2011 12:20AM UTC by james@telfer.com comment:6

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.

Changed February 07, 2011 12:28AM UTC by rwaldron comment:7

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/

Changed February 07, 2011 12:41AM UTC by anonymous comment:8

@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.

Changed February 08, 2011 03:39PM UTC by jitter comment:9

keywords: hover mouseenter mouseleavebrowser-bug
milestone: 1.4.31.5.1
resolution: worksforme
status: closedreopened
version: 1.4.21.5

Changed February 08, 2011 03:40PM UTC by jitter comment:10

keywords: browser-bug
resolution: → duplicate
status: reopenedclosed

Changed February 08, 2011 03:40PM UTC by jitter comment:11

Duplicate of #8209.