Opened 12 years ago
Closed 10 years ago
#7476 closed bug (notabug)
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.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:3 Changed 10 years ago by
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.