Side navigation
#910 closed bug (fixed)
Opened February 02, 2007 11:43AM UTC
Closed February 25, 2007 07:15PM UTC
DOM manipulations with FORM elements fail
Reported by: | Renato | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core | Version: | 1.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you execute this snippet of code, you see the form is not appended, only its children
$("form:first").clone(). appendTo("body");
The problem is in the end of jQuery.clean function at line 498:
if ( arg[0] == undefined ) r.push( arg ); else r = jQuery.merge( r, arg );
In fact, the form element can be used as an array to inspect its inputs, so instead of just pushing the form element, jQuery execute the "else" merging the content of the form element and returning its inputs.
Changing to this code, solves the problem:
if ( arg[0] == undefined || jQuery.nodeName(arg,"form") ) r.push( arg ); else r = jQuery.merge( r, arg );
Attachments (4)
Change History (4)
Changed February 03, 2007 12:47PM UTC by comment:1
Changed February 07, 2007 03:08PM UTC by comment:2
resolution: | → fixed |
---|---|
status: | new → closed |
Fixed in revision 1294.
Thank you for the patch+test.
Changed February 17, 2007 08:58PM UTC by comment:3
resolution: | fixed |
---|---|
status: | closed → reopened |
Reopening because the fix is causing Safari to crash.
Changed February 25, 2007 07:15PM UTC by comment:4
resolution: | → fixed |
---|---|
status: | reopened → closed |
Fixed in Revision 1422.
Here is the patch with the test code to be added to the test suite