Skip to content

Conversation

mattheworiordan
Copy link

Hi Timmy

Please see the updated bug report at http://bugs.jquery.com/ticket/10550, and also take a look at http://jsfiddle.net/JuFxk/10/ where the issue is easily replicable in jsFiddle.

I have included tests and which I hope now adhere to the jQuery guidelines, which fail with IE9 if the manipulation.js file is not updated with this patch.

Please don't close the ticket & pull request this time, it's a real replicable issue.

Matt

@rwaldron
Copy link
Member

That test case is invalid and disproven: http://jsfiddle.net/rwaldron/cq2PB/

@mattheworiordan
Copy link
Author

Please explain why the test case is disproven. I am using standard jQuery functionality to clone an element, and extract the HTML. When that is done, the checked attribute is omitted from the html. That is a bug, and only exists in IE9. With the code I have submitted, I have fixed this issue on IE9. I am really struggling to see how if you write different code you have disproven this bug?

@rwaldron
Copy link
Member

It's disproven because when I reduced your test down to the most minimal case, it could not be reproduced. The test case I created clones a checkbox element and appends the clone back to the document, with checked intact exactly as expected in IE9

@mattheworiordan
Copy link
Author

Why doesn't this work then? Your code modified... http://jsfiddle.net/cq2PB/10/

@mattheworiordan
Copy link
Author

Or try this one. This one shows that the html method of JQuery works on non-cloned nodes, but when it's applied to cloned nodes it fails: http://jsfiddle.net/cq2PB/12/

@timmywil
Copy link
Member

Because just appending the html of the node rids you of everything on the DOM level that was cloned from the node (events, data, properties, etc.) and recreates a new input based solely on the attributes supplied. Though the reason why you thought our test was faulty makes much more sense to me now (because in other browsers setting defaultChecked also writes an attribute into the html), the intention of clone is still intact. Keep the clone intact and everything works as expected. If needed, let's discuss this issue further in the ticket and not open more pull requests.

@timmywil timmywil closed this Oct 21, 2011
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants