Skip to main content

Bug Tracker

Side navigation

#9414 closed bug (patchwelcome)

Opened May 24, 2011 05:39PM UTC

Closed September 08, 2011 08:11PM UTC

In IE 7/8 a div's mouseleave event fires from child open select element that extends below enclosing div

Reported by: dwilks@intacct.com Owned by: dwilks@intacct.com
Priority: low Milestone: 1.next
Component: event Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

I have a div containing a largeish select list. I've bound mouseenter and mouseleave events to the div via the .hover() method. When I open the select list it extends past the bottom of the div. In IE 7 and 8 the mouseleave event is fired when I move the mouse over the select list past the bottom of the enclosing div. Neither Chrome 11 nor Firefox 3.6 exhibit this behavior.

Not sure if this is a bug or enhancement. It could be argued either way.

The (currently) last answer @ http://stackoverflow.com/questions/2096843/funky-jquery-mouseleave-behavior does have a useful workaround that mostly does what I want although it does have the unfortunate deficiency in that it does not fire the mouseleave if the mouse leaves the boundary of the select dropdown.

function onMouseLeave(e) {

if (e &&

typeof e.fromElement != 'undefined' &&

typeof e.fromElement.length != 'undefined') {

return;

}

// ... rest of my mouse leave handler

}

Attachments (0)
Change History (8)

Changed May 25, 2011 05:52AM UTC by addyosmani comment:1

owner: → dwilks@intacct.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket!

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

Changed May 25, 2011 06:39PM UTC by anonymous comment:2

Here's a simple example: http://jsfiddle.net/KTEax/

One thing that I noticed is that in this example the mouseleave is fired as soon as the cursor enters the dropdown list where I was seeing it fire when the cursor left the div while over the dropdown list. Either way it's not the behavior I was expecting.

Changed June 09, 2011 08:09AM UTC by trac-o-bot comment:3

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed June 09, 2011 04:14PM UTC by dwilks comment:4

Why didn't my comment from two weeks ago change the status from pending so you'd recognize that I'd replied? I'm assuming that making this comment won't re-open the bug since the section below only says "leave as closed."

Changed June 09, 2011 05:01PM UTC by ajpiano comment:5

resolution: invalid
status: closedreopened

Because you replied as anonymous, not as dwilks :) I'll reopen.

Changed June 11, 2011 07:31PM UTC by dmethvin comment:6

component: unfiledevent
priority: undecidedlow
status: reopenedopen

Fixable via withinElement() maybe?

Changed June 11, 2011 08:04PM UTC by rwaldron comment:7

@dmethvin I still have an open pull request for the withinElement re-write, I'l try to compare this issue with my patch sometime today (@ TXJS)

Changed September 08, 2011 08:11PM UTC by dmethvin comment:8

resolution: → patchwelcome
status: openclosed

In 1.7 I've rewritten the mouse* event handling but don't see a way to solve this one. If we throw away the mouseleave that you don't want at that point, the browser will never give us another. It's a case that's edgy enough to be solved by application code rather than in jQuery core.

I'll close the ticket as patchwelcome in case someone can come up with a solution I haven't thought of, but any patch should be small since fixing this doesn't justify a high size/performance cost.