Search and Top Navigation
#7476 closed bug (notabug)
Opened June 15, 2011 03:12AM UTC
Closed October 15, 2012 08:30PM UTC
Button: Dynamically injecting a "checked" checkbox has the incorrect state
Reported by: | duereg | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.11.0 |
Component: | ui.button | Version: | 1.8.9 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I am trying to create a button that contains a checkbox - but not a checkbox button.
In my code, I set the state of the checkbox to checked. If I load this checkbox without putting it into the button, I can confirm that the checkbox is checked.
However, as soon as the div containing the checkbox has .button called on it, the checkbox is unchecked.
I've tested this against IE 9, Firefox 4, Chrome 12, and this behavior is consistent across browsers.
Attachments (0)
Change History (3)
Changed June 15, 2011 12:47PM UTC by comment:1
Changed October 11, 2012 02:43PM UTC by comment:2
milestone: | 1.9.0 → 1.11.0 |
---|
Changed October 15, 2012 08:30PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | new → closed |
summary: | Creating a button containing a checkbox - but not a checkbox button - removes the state of the checkbox → Button: Dynamically injecting a "checked" checkbox has the incorrect state |
It seems like you are trying to reflect the state of the "button" in this situation. Please see the below JSFiddle for an example of how you might accomplish this without using a "checkbox" within a button.
This only happens with when the checkbox is checked programmatically. Changing the code to created a checked checkbox using $( "<input type=checkbox checked>" ) doesn't have a problem.