Topic: Active button is always active inside button-group

Joachim Schneider priority asked 2 years ago

Expected behavior When I click on the 2nd button inside a button-group, the active button should become inactive.

Actual behavior The "Button1" stays active when the 2nd button is clicked.


<div class="btn-group shadow-1" role="group">
  <button href="#!" class="btn btn-link active">Button1</button>
  <button href="#!" class="btn btn-link">Button2</button>
  <button href="#!" class="btn btn-link">Button3</button>

Is there a an other way to pre-select a button inside a button-group?

Thanks a lot

Michał Duszak staff answered 2 years ago

Hello, the behaviour you described matches Radio buttons

Joachim Schneider priority commented 2 years ago

Thanks, this works as expected.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: Web
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No