#5743 closed bug (fixed)
$.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: | [email protected]… |
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.
Change History (4)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in 89c0961. Thanks sciyoshi.
comment:3 Changed 13 years ago by
Milestone: | 1.9 → 1.8.3 |
---|
comment:4 Changed 12 years ago by
Core (widget): don't pass DOM objects to $.fn.add. Fixes #5743 ($.fn.remove does not trigger remove event for <select>s)
Changeset: 89c0961c3849db0d804b337f2d438c822074b112
Note: See
TracTickets for help on using
tickets.
Fixed in my github fork - commit can be found at http://github.com/sciyoshi/jquery-ui/commit/53982e7be3da866b883500fcc1f48645b0398d77