Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.btn-group-sm does not work with dropdown in Bootstrap 5.3.3 #40836

Closed
3 tasks done
vtofeliuk opened this issue Sep 14, 2024 · 1 comment
Closed
3 tasks done

.btn-group-sm does not work with dropdown in Bootstrap 5.3.3 #40836

vtofeliuk opened this issue Sep 14, 2024 · 1 comment
Labels

Comments

@vtofeliuk
Copy link

Prerequisites

Describe the issue

In Bootstrap 5.3.3, when using the btn-group-sm class with a button group that includes a dropdown, the small size class does not apply to the buttons and dropdown correctly. As a result, the dropdown button does not scale down properly, while the rest of the buttons do. This issue can be observed with standard markup for button groups and dropdowns.

Please see the screenshots:

btn-group-v1 btn-group-v2

Reduced test cases

https://getbootstrap.com/docs/5.3/components/button-group/
https://stackblitz.com/edit/8fqjnj?file=index.html

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome, Safari

What version of Bootstrap are you using?

5.3.3

@julien-deramond julien-deramond changed the title btn-group-sm does not work with dropdown in Bootstrap 5.3.3” .btn-group-sm does not work with dropdown in Bootstrap 5.3.3 Sep 16, 2024
@julien-deramond
Copy link
Member

Hello @vtofeliuk
It's maybe not that explicit in the documentation, but it's mentioned in Button group > Sizing:

Instead of applying button sizing classes to every button in a group, just add .btn-group-* to each .btn-group, including each one when nesting multiple groups.

In your case, it would mean adding a .btn-group-sm to the nested .btn-group:

<div class="btn-group btn-group-sm" role="group" aria-label="Button group with nested dropdown">
  <button type="button" class="btn btn-primary">1</button>
  <button type="button" class="btn btn-primary">2</button>

-  <div class="btn-group" role="group">
+  <div class="btn-group btn-group-sm" role="group">
    <button
      type="button"
      class="btn btn-primary dropdown-toggle"
      data-bs-toggle="dropdown"
      aria-expanded="false"
    >
      Dropdown
    </button>
    <ul class="dropdown-menu" style="">
      <li><a class="dropdown-item" href="#">Dropdown link</a></li>
      <li><a class="dropdown-item" href="#">Dropdown link</a></li>
    </ul>
  </div>
</div>

@julien-deramond julien-deramond closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants