Side navigation
#1095 closed bug (worksforme)
Opened April 03, 2007 05:46PM UTC
Closed December 01, 2009 10:33PM UTC
Hiding/showing div clears radio checks
Reported by: | jimzim | Owned by: | davidserduke |
---|---|---|---|
Priority: | minor | Milestone: | 1.2.2 |
Component: | effects | Version: | 1.1.3 |
Keywords: | radio checked show hide unchecked | Cc: | |
Blocked by: | Blocking: |
Description
Hi,
I'm running into a problem where hiding/showing a div clears all checked radios within that div.
I reduced the problem code down to the bare minimum to still exhibit the problem. It's attached, or try it out at http://www.thatphonecall.com/jqueryproblem.htm
Is this behavior expected? If so, wouldn't it be more intuitive for show/hide to not clear the checks in radios?
I'm experiencing this problem in IE 6.0.2900.2180...
Thanks,
Jim
Attachments (2)
Change History (12)
Changed April 03, 2007 07:36PM UTC by comment:1
Changed April 05, 2007 01:57PM UTC by comment:2
Note that the problem goes away when animation is removed. This works:
$('#hiddenpart').show();
Alerting the 'checked' property of the input shows that it changes from 'true' before the animation to 'undefined' afterwards.
Changed July 21, 2007 02:58PM UTC by comment:3
component: | interface → fx |
---|---|
description: | Hi,\ \ I'm running into a problem where hiding/showing a div clears all checked radios within that div.\ \ I reduced the problem code down to the bare minimum to still exhibit the problem. It's attached, or try it out at http://www.thatphonecall.com/jqueryproblem.htm\ \ Is this behavior expected? If so, wouldn't it be more intuitive for show/hide to not clear the checks in radios?\ \ I'm experiencing this problem in IE 6.0.2900.2180...\ \ Thanks,\ Jim → Hi, \ \ I'm running into a problem where hiding/showing a div clears all checked radios within that div. \ \ I reduced the problem code down to the bare minimum to still exhibit the problem. It's attached, or try it out at http://www.thatphonecall.com/jqueryproblem.htm \ \ Is this behavior expected? If so, wouldn't it be more intuitive for show/hide to not clear the checks in radios? \ \ I'm experiencing this problem in IE 6.0.2900.2180... \ \ Thanks, \ Jim |
milestone: | 1.1.3 → 1.1.4 |
owner: | stefan |
priority: | major → minor |
version: | 1.1.2 → 1.1.3 |
Changed October 01, 2007 10:38PM UTC by comment:4
This problem is happening in both IE6 and IE7. It happens when any kind of animation is used to show the container of the radio buttons, but not until the second time the container is shown. Animation to hide the div doesn't affect the checked state of the radio buttons.
Changed October 02, 2007 07:56PM UTC by comment:5
The problem here appears to be caused when jQuery.css() clones the node and adds it to the form. The code removes the "checked" attribute, but not the "defaultChecked" one. I guess IE decides to check it when it is appeneded if the defaultChecked is set. Adding a removeAttr("defaultChecked") on all radio buttons seems to work at least for this test case.
I'll attach a patch.
Changed November 05, 2007 05:34PM UTC by comment:6
I have not applied the attached patch, so take this with a grain of salt...
I did a dirty test of this by applying removeAttr("defaultChecked") to input:radio and reset buttons no longer function properly.
Changed November 06, 2007 04:32PM UTC by comment:7
Actually if you look closer at the code, the removeAttr("defaultChecked") call is not supposed to be on the actual radio buttons but just on the cloned ones. These cloned ones are just used to get the width/height of the element while it is hidden. So reset will work just fine.
Changed November 15, 2007 01:47PM UTC by comment:8
need: | Review → Commit |
---|---|
owner: | → davidserduke |
Changed November 15, 2007 01:48PM UTC by comment:9
milestone: | 1.1.4 → 1.2.2 |
---|
Changed November 16, 2007 11:41PM UTC by comment:10
resolution: | → fixed |
---|---|
status: | new → closed |
Fixed in [3839].
Changed October 09, 2009 01:17PM UTC by comment:11
resolution: | fixed |
---|---|
status: | closed → reopened |
This bug is active again in version 1.3.2: performing the test case on a default IE7 setup (not the compatibility view in IE8) leaves both radio buttons unchecked.
Changed December 01, 2009 10:33PM UTC by comment:12
resolution: | → worksforme |
---|---|
status: | reopened → closed |
Can't reproduce on head. Added a test for animations.
Whoops. I left a critical line (line 12) commented out in the attachment. Please disregard the first attachment, and refer only to the 2nd one.