Search and Top Navigation
#5743 closed bug (fixed)
Opened June 19, 2010 08:45AM UTC
Closed July 08, 2010 04:11PM UTC
Last modified November 19, 2010 06:25PM UTC
$.fn.remove does not trigger remove event for <select>s
Reported by: | sciyoshi | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.3 |
Component: | ui.widget | Version: | 1.8.2 |
Keywords: | select, option, remove, widget, dropdown | Cc: | sciyoshi@gmail.com |
Blocked by: | Blocking: |
Description
Minimal test case:
$('<select><option>Option</option></select>') .appendTo('body') .bind('remove', function() { alert('This dialog should show...'); }) .remove();
This code used to work with jQuery 1.3 but no longer works with 1.4, breaking certain widgets that are meant to be attached to <select> elements (in my case, jquery-dropdownchecklist).
The bug is caused by behaviour changed in jQuery 1.4: $.makeArray (called by $.fn.add) now checks for a length property, which a <select> DOM element will have.
Fixed in my github fork - commit can be found at http://github.com/sciyoshi/jquery-ui/commit/53982e7be3da866b883500fcc1f48645b0398d77