Add possibility to hide Dropdown Toggle Caret
See original GitHub issueI recently stumbled across the problem that there is no “out-of-the-box” way to hide the dropdown toggles caret which gets added by default.
This would be handy for situations like this where you want to provide additional actions behind a “…”-button: https://codepen.io/jackmu95/pen/jLeRdM
A good and easy solution for me would be to add a dropdown-toggle-no-caret class to the dropdown toggle:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle dropdown-toggle-no-caret" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
...
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
// scss/_dropdown.scss
.dropdown-toggle:not(.dropdown-toggle-no-caret) {
...
}
.dropup {
...
.dropdown-toggle:not(.dropdown-toggle-no-caret) {
...
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (8 by maintainers)
Top Results From Across the Web
How to remove the arrow in dropdown in Bootstrap 4?
Simply remove " dropdown-toggle " class from the element. The dropdown will still work if you have the data-toggle attribute as follows
Read more >How to remove arrow in dropdown in Bootstrap - GeeksforGeeks
In this case, the content is a dropdown arrow. To remove it, just make the content go 'none'. Syntax: .my-dropdown-toggle::after { content: ...
Read more >Removing the caret icon on dropdowns
Hi,. I searched and could not find any way for removing the caret icon on the dropdown toggle component. Is there any way...
Read more >Dropdowns - Bootstrap
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the .show class on the parent list item....
Read more >DropDownButton / How To / Hide dropdown arrow - React
You can hide the dropdown arrow from the DropDownButton by adding class e-caret-hide to DropDownButton element using cssClass property. Source. Preview.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just for information and to eventually weigh in, removing .dropdown-toggle in a .btn-group makes corner rounding issues.
Using the example from https://getbootstrap.com/docs/4.0/components/button-group/ but without ‘dropdown-toggle’
<div class="btn-group" role="group" aria-label="Button group with nested dropdown"> <button type="button" class="btn btn-secondary">1</button> <button type="button" class="btn btn-secondary">2</button> <div class="btn-group" role="group"> <button id="btnGroupDrop1" type="button" class="btn btn-secondary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Dropdown </button> <div class="dropdown-menu" aria-labelledby="btnGroupDrop1"> Dropdown link Dropdown link </div> </div> </div>This would be a nice thing to have. A simple extra CSS class would be cool.