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

WVU Nav Dropdowns breaks Bootstrap dropdowns #267

Open
adamjohnson opened this issue Jun 11, 2020 · 1 comment
Open

WVU Nav Dropdowns breaks Bootstrap dropdowns #267

adamjohnson opened this issue Jun 11, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@adamjohnson
Copy link
Contributor

The problem

Today @rebecca-patton found out that the WVU dropdown navigation we use in the design system shares a class with Bootstrap dropdowns: .dropdown-toggle.

If someone wants to use a Bootstrap dropdown, the styles from the WVU Nav Dropdowns hide the Bootstrap dropdown (via display: none;, here's the relevant line).

The fix

To fix this, we should re-name the .dropdown-toggle class in the WVU Nav Dropdowns to something else.

Here's a (not very semantic) Bootstrap dropdown to test with:

  <div class="dropdown">
    <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      Services
    </button>
    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
      <div class="dropdown-header">Service Options</div> <!-- Heading? -->
      <a class="dropdown-item" href="#">Item 1</a> <!-- List?? -->
      <a class="dropdown-item" href="#">Item 2</a>
      <a class="dropdown-item" href="#">Item 3</a>
      <a class="dropdown-item" href="#">Item 4</a>
      <div class="dropdown-divider"></div>
      <a class="dropdown-item" href="#">Other</a>
    </div>
  </div>
@adamjohnson adamjohnson added the bug Something isn't working label Jun 11, 2020
@zeroedin
Copy link
Contributor

This has been a problem for quite awhile. Here is how I fix it in my applications. First, comment out old file, create a custom/_wuv-nav-dropdowns.scss

Here is the diff between the two: https://www.diffchecker.com/btF7IsI2

Then you'll need to fix any reference in navbar html classes from the following list

.dropdown to .wvu-dropdown
.dropdown-toggle to .wvu-dropdown-toggle
.dropdown-active to .wvu-dropdown-active

The better fix would be to remove this navbar and replace it with bootstraps navbar. This has come up in several conversation before. I know hover menus have been part of the conversation of why it hasn't been done prior, but there are fixes for that https://codepen.io/tutsplus/details/eYOGmeE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants