-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Revisit Button Group HTML #3264
Comments
@kwinters I think you have a totally valid point there. @chrisirhc Any idea why the buttons where changed to labels back then? If the labels would contain a checkbox/radio input it would make sense but they don't. Btw; we're looking into full Bootstrap compatibility for milestone |
This refers to the demo site's code. We can improve on this by including the Edit: See below. |
After digging in and checking bootstrap's source I would say for semantical and accessibility reasons we should add an But, after I checked out Bootstrap's CSS I noticed that they target the internal
So either we have to add @chrisirhc beat me to it. |
I would say adding |
I see, that sounds reasonable. If a btn-checkbox element contains any input elements within, hide them. Encourages better accessibility code. However, take note of the notes written around the styles: https://github.com/twbs/bootstrap/blob/master/less/button-groups.less#L221-L243
So we might want to use the same styles. |
Good point! I'll take care of this after 0.13 is out. |
In 7727341 the button group code was changed from buttons to labels, Closes #1323. Closes #1482
But I think it's time to revisit that decision (2013).
http://getbootstrap.com/javascript/#buttons-checkbox-radio uses a label and an input, and none of the examples in http://getbootstrap.com/components/#btn-groups have labels at all.
The above commit's message is "Align with BS3 markup." but the code does not meet that goal, at least anymore. From the other threads, it looks like the example started with the input + label format and then determined that the inputs were not required, ending up with just label. However it appears that the typical usage is to use either actual buttons or divs, not orphaned labels.
And I think that the use of labels in this way should be discouraged in general. Labels tend to have styling associated with them that are not appropriate for an element that acts like a button.
The text was updated successfully, but these errors were encountered: