Bug Tracker

Opened 17 years ago

Closed 16 years ago

Last modified 12 years ago

#769 closed bug (wontfix)

Checkbox's state is erased after wrap() or append() action (IE 6)

Reported by: Mehdi Kabab Owned by: brandon
Priority: major Milestone: 1.2.2
Component: core Version: 1.1.3
Keywords: wrap append Cc:
Blocked by: Blocking:

Description (last modified by brandon)

When you wrap a checkbox checked, check state is erased.

Testpage : http://gimp4you.eu.org/sandbox/js/test/wrap.html

(jQuery 1.0.4)

Attachments (2)

jquery_test.html (946 bytes) - added by davidserduke 16 years ago.
test case
769.diff (882 bytes) - added by davidserduke 16 years ago.
patch

Download all attachments as: .zip

Change History (13)

comment:1 Changed 17 years ago by aaron.heimli

FYI, this issue is fixed in IE7, but an IE6 fix doesn't appear to be that difficult to implement.

comment:2 Changed 17 years ago by Mehdi Kabab

Ok.

I had update the testpage for added prepend method test. The result is similar in IE 6 (with append method too).

comment:3 Changed 17 years ago by Mehdi Kabab

Hi,

The testpage has been update for jQuery 1.1b I'm encoured always the bug in IE 6.

comment:4 Changed 17 years ago by john

need: Test Case

comment:5 Changed 17 years ago by joern

need: Test CasePatch

Added test in [1590].

comment:6 Changed 16 years ago by brandon

Description: modified (diff)
need: PatchReview

The test for this seems to have changed since [1590]. It looks like the third test is testing for !checked but shouldn't it be checking for checked?

comment:7 Changed 16 years ago by brandon

Owner: set to brandon

comment:8 Changed 16 years ago by brandon

Keywords: append added
Milestone: 1.1.4
Summary: Checkbox's state is erased after wrap() action (IE 6)Checkbox's state is erased after wrap() or append() action (IE 6)
Version: 1.1.3

Changed 16 years ago by davidserduke

Attachment: jquery_test.html added

test case

comment:9 Changed 16 years ago by davidserduke

This is an IE6 bug in the way it handles functions like appendChild. IE6 clears the "checked" property (even from children) during these functions. This is shown by the second button in the new test case. It really isn't a wrap issue at all except that wrap calls appendChild eventually.

The only real fix I see at this point is to save the state of the elem.checked and all its children and after the appendChild set them correctly if necessary. That is what the patch does and it fixes the test case. Unfortunately IE6 is likely to see a speed hit since it is necessary to recurse down any tree moved saving the checked values. I'm not sure it's worth it.

Changed 16 years ago by davidserduke

Attachment: 769.diff added

patch

comment:10 Changed 16 years ago by davidserduke

Milestone: 1.1.41.2.2

Closed bugs #1866 and #1962 as duplicates but noting it here for reference as the first one has a test case.

comment:11 Changed 16 years ago by brandon

Resolution: wontfix
Status: newclosed

I'm very concerned about the performance hit involved with fixing this issue. The work around is to store the value of the inputs before and restoring the values after wrapping or appending.

Note: See TracTickets for help on using tickets.