Side navigation
#6912 closed bug (fixed)
Opened August 17, 2010 02:29PM UTC
Closed April 17, 2011 05:51PM UTC
Last modified May 04, 2011 02:11PM UTC
$().add(selectElement) adds option children instead
Reported by: | ratbeard | Owned by: | john |
---|---|---|---|
Priority: | low | Milestone: | 1.6 |
Component: | traversing | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Passing a raw dom select element to jQuery.fn.add adds all of its option
children to the collection, instead of the select element itself.
Array.prototype.slice.call() inside makeArray gets confused probably due to the select element having a length
property.
Tested this in Chrome 5 and FF 3.6 on osx 10.6.
Workaround is to wrap the select element in jQuery()
Attachments (1)
Change History (5)
Changed August 19, 2010 02:17AM UTC by comment:1
Changed October 15, 2010 04:32AM UTC by comment:2
milestone: | 1.4.3 |
---|---|
priority: | → low |
status: | new → open |
version: | 1.4.2 → 1.4.3 |
Changed April 17, 2011 05:50PM UTC by comment:3
milestone: | → 1.6 |
---|---|
owner: | → john |
status: | open → assigned |
There is a similar situation with
elements but it seems to be by intent because there is a test case to verify that adding a form actually adds the form.elements collection.It seems that
should do the same thing as , and the same goes for .If that was the case, it might be easiest to fix this issue in
by not turning DOMElement with into an array of its children.