Button States not setting property "checked"
August 23, 2016 at 6:19 pmPosts: 8Member Reply #7591
This may be intended, but the “button states” buttons do not check the underlying control. All they do is set an “active” class on the label. This is fine for presentation, but if these buttons are linked to checkboxes or radios shouldn’t they correctly set the “checked” property?
Likewise problematically setting the underlying checkbox or radio to “checked” should also alter it’s presentation state.
- This topic was modified 2 years, 11 months ago by maarbole.
August 23, 2016 at 6:43 pmPosts: 8Member Reply #7594
You guys may still be interested in adding this functionality to your theme, but in the mean time I will just program it in myself.
August 23, 2016 at 7:39 pmPosts: 8Member Reply #7607
Well, I’m back again to say that my ignorance is to blame here. Apparently, clicking the buttons does change the property, but changing the property isn’t reflected in the dom (at least not while inspecting it in the developer console). By simply running
$('#myinput').prop("checked"), I was able to see that the property was in fact being set appropriately.
The only issue would be setting the active state of the button appropriately, however this is easily solved by triggering a click event as opposed to setting the prop directly.
For anyone else who may be searching about this, I basically fixed my problems by doing this:
instead of this:
- This reply was modified 2 years, 11 months ago by maarbole.
You must be logged in to reply to this topic.