Bug Tracker

Modify

Ticket #769 (closed bug: wontfix)

Opened 6 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

Description (last modified by brandon) (diff)

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

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

Change History

comment:1 Changed 6 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 6 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 6 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 6 years ago by john

  • need set to Test Case

comment:5 Changed 6 years ago by joern

  • need changed from Test Case to Patch

Added test in [1590].

comment:6 Changed 6 years ago by brandon

  • need changed from Patch to Review
  • Description modified (diff)

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 6 years ago by brandon

  • Owner set to brandon

comment:8 Changed 6 years ago by brandon

  • Keywords append added
  • Summary changed from Checkbox's state is erased after wrap() action (IE 6) to Checkbox's state is erased after wrap() or append() action (IE 6)
  • Version set to 1.1.3
  • Milestone set to 1.1.4

Changed 6 years ago by davidserduke

test case

comment:9 Changed 6 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 6 years ago by davidserduke

patch

comment:10 Changed 6 years ago by davidserduke

  • Milestone changed from 1.1.4 to 1.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 6 years ago by brandon

  • Status changed from new to closed
  • Resolution set to wontfix

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.