Skip to main content

Bug Tracker

Side navigation

#769 closed bug (wontfix)

Opened January 09, 2007 02:51PM UTC

Closed December 08, 2007 05:10AM UTC

Last modified March 13, 2012 09:49PM UTC

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

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)
  • 769.diff (0.9 KB) - added by davidserduke November 07, 2007 01:00AM UTC.

    patch

  • jquery_test.html (0.9 KB) - added by davidserduke November 06, 2007 10:23PM UTC.

    test case

Change History (11)

Changed January 09, 2007 07:13PM UTC by aaron.heimli comment:1

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

Changed January 10, 2007 09:11AM UTC by Mehdi Kabab comment:2

Ok.

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

Changed January 11, 2007 09:57AM UTC by Mehdi Kabab comment:3

Hi,

The testpage has been update for jQuery 1.1b

I'm encoured always the bug in IE 6.

Changed March 24, 2007 05:41PM UTC by john comment:4

need: → Test Case

Changed March 25, 2007 12:32PM UTC by joern comment:5

need: Test CasePatch

Added test in [1590].

Changed May 16, 2007 03:46PM UTC by brandon comment:6

description: When you wrap a checkbox checked, check state is erased.\ \ Testpage : http://gimp4you.eu.org/sandbox/js/test/wrap.html\ \ (jQuery 1.0.4)When you wrap a checkbox checked, check state is erased. \ \ Testpage : http://gimp4you.eu.org/sandbox/js/test/wrap.html \ \ (jQuery 1.0.4)
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?

Changed July 20, 2007 09:25PM UTC by brandon comment:7

owner: → brandon

Changed July 21, 2007 05:05AM UTC by brandon comment:8

keywords: wrapwrap append
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 November 06, 2007 11:06PM UTC by davidserduke comment:9

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 November 27, 2007 07:58PM UTC by davidserduke comment:10

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.

Changed December 08, 2007 05:10AM UTC by brandon comment:11

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.