question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add possibility to hide Dropdown Toggle Caret

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fafourniercommented, Jun 5, 2018

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>
0reactions
DaleyKDcommented, Jan 14, 2020

This would be a nice thing to have. A simple extra CSS class would be cool.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found