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.

(dropdown+nav-item-dropdown): `noCaret` option causes unwanted side effects

See original GitHub issue

Enabling the noCaret option on the dropdown or nav-item-dropdown component causes some unwanted styling issues due to dropping the .dropdown-toggle class.

Bootstrap uses this class for some minor styling changes for dropdowns in button-groups, input-groups and even the button itself.

A better solution would be to add a custom class like .dropdown-toggle-no-caret to the dropdown-toggle when the noCaret option is set and use some custom CSS to hide the caret.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:18 (16 by maintainers)

github_iconTop GitHub Comments

7reactions
curtgrimescommented, Apr 9, 2018

A quick and dirty way to fix the rounded corner issue when using no-caret on a dropdown button is to add Bootstrap’s new rounded class.

Example (first button does not have class, second button has the class applied with toggle-class="rounded"):

screenshot 2018-04-09 17 22 37
<b-dropdown variant="danger" dropup no-caret right class="mr-2">
  <template slot="button-content">
    <i class="fa fa-desktop" aria-hidden="true"></i> <span class="sr-only">Screens</span>
  </template>
</b-dropdown>

<!-- toggle-class="rounded" added to fix button corners when no-caret is in use -->
<b-dropdown variant="danger" dropup no-caret right class="mr-2" toggle-class="rounded">
  <template slot="button-content">
    <i class="fa fa-desktop" aria-hidden="true"></i> <span class="sr-only">Screens</span>
  </template>
</b-dropdown>
4reactions
tmorehousecommented, Dec 16, 2017

@jackmu95 we currently try and follow the bootstrap V4 styles where possible, without creating new styling classes.

There has been muttering over at Bootstrap on github about no caret options for dropdowns, but nothing set in stone other than the mentioned removal of the dropdown-toggle class.

If there are changes over at Bootstrap V4 for handling a no caret toggle via classes, then we will definitely adjust how it is handled in Bootstrap-vue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid dropdown menu close on click inside - Stack Overflow
By default, the dropdown menu is closed when clicking inside or outside the dropdown menu. You can use the autoClose option to change...
Read more >
Dropdowns · Bootstrap v5.0
Overview. Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap ...
Read more >
Dropdown | Components - BootstrapVue
Dropdowns are toggleable, contextual overlays for displaying lists of links and actions in a dropdown menu format.
Read more >
Bootstrap 4 Dropdown - examples & tutorial.
Bootstrap dropdown is a toggleable menu embedding additional links or content. It allows you to construct advanced navigation and link categorization.
Read more >
Dropdowns | React-Bootstrap
On the other hand, Bootstrap's dropdowns are designed to more generic and application in a variety of situations. For this reason we don't...
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