Skip to main content

Bug Tracker

Side navigation

#15229 closed bug (cantfix)

Opened September 04, 2014 04:38PM UTC

Closed September 04, 2014 07:28PM UTC

IE: Mouseleave fires on table element when select options open

Reported by: Mottie Owned by: Mottie
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:
Description

I have a table containing selects within a column. An event listener is attached to the table (or tbody) to perform another action (e.g. give focus to another element).

In IE10+, when the user tries to open the select, it immediately closes because when hovering over the select options the table "mouseleave" event fires.

Here is a demo of this issue: http://jsfiddle.net/eY8uH/1073/

One fix would be to ensure the event.target is the same as the original element: http://jsfiddle.net/eY8uH/1075/

$('table').on('mouseleave', function(e){
    if (e.target.tagName === 'TABLE') {
        $(':focus').blur();
    }
});
Attachments (0)
Change History (3)

Changed September 04, 2014 06:53PM UTC by dmethvin comment:1

owner: → Mottie
status: newpending

I agree this looks like a bug, and it seems to have been around a while. Has this been reported to Microsoft as a bug?

The mouseleave event bubbles up the DOM tree, so it's not wrong for such an event to have an event.target that is not the element where the event is attached. In your particular case you know what you expect and can do a workaround, but I don't know of a general one that can be done at the jQuery level.

Changed September 04, 2014 07:10PM UTC by Mottie comment:2

status: pendingnew

I only just reported this issue (https://connect.microsoft.com/IE/feedbackdetail/view/962618/).

I only reported this issue as maybe something jQuery can do to filter out the unexpected event since only IE appears to cause this particular problem.... but you're right, changing this within jQuery would cause other issues. So, thank you and please feel free to close this issue.

Changed September 04, 2014 07:28PM UTC by dmethvin comment:3

resolution: → cantfix
status: newclosed