Skip to content

data-toggle="button" initial active state #11535

@aaronchi

Description

@aaronchi

Using data-toggle="buttons" doesn't set the initial active state of the radio/checkbox buttons if they are already checked.

In the following example, the first button should get a class of active when the widget is initialized, but it does not.

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option1" checked="checked"> Option 1
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option2"> Option 2
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option3"> Option 3
  </label>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions