Skip to main content

Search and Top Navigation

#2597 closed bug (fixed)

Opened March 27, 2008 04:44PM UTC

Closed April 17, 2008 11:47AM UTC

Last modified February 26, 2009 11:27AM UTC

Droppable events fired on hidden elements

Reported by: chrishandorf Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.3
Keywords: drop event hidden Cc:
Blocked by: Blocking:
Description

I created a Mac like hierarchical folder tree type widget using jQuery UI. When the triangle next to a folder is clicked it causes an open folder to hide its contents using jQuery UI functions such as hide() or slideToggle(). I found that even though these elements were not displayed in the web browser they were still receiving many droppable() events such as ".drop" and ".over". These events did not occur at the location where the elements were just hidden, but rather at the very top parent div that contained the elements many levels lower.

I was able to correct the problem with the following function, but it seems to me that jQuery UI should never fire a "drop" or "over" event on an element that is set to CSS display:none (or if any of the parents() of the element are set to CSS display:none).

function eventShouldBeIgnored(item) {

var ignore = false;

$(item).parents().each(function() {

if ($(this).css("display") == "none") {

ignore = true;

}

});

return ignore;

}

Attachments (0)
Change History (4)

Changed April 16, 2008 08:27AM UTC by paul comment:1

status: newassigned

Changed April 17, 2008 11:47AM UTC by paul comment:2

resolution: → fixed
status: assignedclosed

Changed May 24, 2008 03:39AM UTC by comment:3

milestone: 1.2.3

Milestone 1.2.3 deleted

Changed February 26, 2009 11:27AM UTC by paul comment:4

milestone: → 1.5