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

Collapsed navbar navpill links are all in active state #23482

Closed
haraldpdl opened this issue Aug 16, 2017 · 7 comments
Closed

Collapsed navbar navpill links are all in active state #23482

haraldpdl opened this issue Aug 16, 2017 · 7 comments

Comments

@haraldpdl
Copy link

haraldpdl commented Aug 16, 2017

Bootstrap 4.0.0-beta1

Navpill links in a navbar are all displayed in an active state when collapsed. Tested with Edge/Firefox/Chrome. Example:

https://www.bootply.com/VAyFaYVO64

(please click on the mobile icon to show the collapsed view)

@haraldpdl
Copy link
Author

It worked fine with 4.0.0-alpha6:

https://www.bootply.com/GlyaAISMhM

@Johann-S
Copy link
Member

Not sure if it's a JavaScript issue or not but it can be

@danijelGombac
Copy link

I think is related to this .collapse.show:

.nav-pills .nav-link.active,
.show > .nav-pills .nav-link {
color: #fff;
background-color: #007bff;
}

@pat270
Copy link
Contributor

pat270 commented Aug 17, 2017

#22513 will probably fix this.

@insad
Copy link

insad commented Sep 30, 2017

Solved the problem by patching _nav.scss:

//
// Pills
//

.nav-pills {
  .nav-link {
    @include border-radius($nav-pills-border-radius);

    &.active,
    .show > &.active { /* Patch */
      color: $nav-pills-link-active-color;
      background-color: $nav-pills-link-active-bg;
    }
  }
}

@mdo mdo closed this as completed in #22513 Oct 3, 2017
@mdo mdo mentioned this issue Oct 3, 2017
@mrjack88
Copy link

I am running into the same issue, when nav-bar collapses, all nav-pills are shown as active, and then when returned to a size bigger than md all nav-pills are active. Here is the sample code: https://codepen.io/mrjack88/full/qPXGaq/. Do you think i should grab alpha version, where it seems to work right according to this thread in the top?
PS. I am using 4.0.0-beta from CDN

@insad
Copy link

insad commented Oct 13, 2017

Simply download the latest development version and host it on your own server instead of using CDN... this problem and many others will be gone away...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants