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
Updating from 5.2.0 to 5.2.1 broke hover behaviour in nav-items and dropdown items #37105
Comments
When comparing v5.2.0 and v5.2.1 I don't see at first glance in our (S)CSS modifications what could have generated this issue. Maybe things that have been modified in buttons.scss 🤷 |
Thank you for the quick response. I am still a little bit in the dark, but noticed the following: Having a simple Here is an example, where if you change the bootstrap import to the latest, in Chrome, it does not show the outline anymore. https://codepen.io/phev8/pen/wvjMyXL Probably this is referenced then in issue #37106 |
See #37106 (comment) |
I think my issues might be related that these variable overrides are not working as before:
I could not figure it out yet, how can I reproduce this variable overrides with CodePen, if someone has quick example, of how to use the scss variables there, I am glad for a quick hint :-) |
Created two StackBlitz projects to check your last minimalistic case including your variable overrides: Maybe I've made some errors creating it (just added some |
Thank you for the examples. It's very strange, since with my local installation I had 5.2.0 installed before and it was working... but not on the StackBlitz example, I had to go back to 5.1.3 then it's how we had it. Includes the example how you created, using version 5.1.3, and "bootstrap/maps" commented out (not there yet). In the examples, from version 5.2.0 the variable overrides for the nav-link do not seem to work the way we had there anymore. Did we miss some deprecations there? |
Created an updated StackBlitz based on my previous example on v5.2.1. In In the HTML I changed the structure to have a <ul class="nav flex-column bg-primary">
<li class="nav-item">
<a href="#" class="nav-link">Link 1</a>
</li>
<li class="nav-item">
<a href="#" class="text-body nav-link active">Link 2</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Link 3</a>
</li>
</ul>
Lines 6 to 12 in 23e5082
Is that useful for you? |
Thank you very much, it is useful! Through this, I also noticed what my actual problem is and how to fix it after upgrade. The only question remaining, if this is intentional:
With previous versions, attaching the "btn" class worked fine for me, with 5.2.0, when nav-link is active and has btn class, now I also have to extra remove the border. With latest update however, when nav-link also has the btn tag, the btn styling seems to have priority or modifies the prefix, I don't know. So the nav-link color is not applied in hover state any more. Updated your example with the case here: The same thing was my issue, when using "dropdown-item" - if the item had "btn" class also attached, it broke the expected hover style. So in my use case, removing my "btn" class helped me fix the different behaviour. Also for the nav-links, previously, it was kinda necessary (in my setup, for some reason...) to add the "btn" class, but now it works well without. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This will be fixed I think by the button changes in #37165, which was just merged. |
Prerequisites
Describe the issue
This being a patch release, we did not expect breaking changes, but apparently some behaviour broke hover styles for nav-link / btn and dropdown items (used from react-bootstrap).
I checked the changelog, but I could not identify what the related change is and where we should start looking. Is the changelog maybe incomplete?
Our app's behaviour before update:
Screen.Recording.2022-09-08.at.09.21.44.mov
After update:
Screen.Recording.2022-09-08.at.09.22.29.mov
(The only change between the two was to update bootstrap from 5.2.0 to 5.2.1)
The same update causes issues when using the Dropdown items from react bootstrap:
Before:
https://user-images.githubusercontent.com/13927969/189118800-9b7e6864-0251-4ed7-9314-9758503bfedd.mov
After (The slight background color change not there anymore):
https://user-images.githubusercontent.com/13927969/189118806-fc2618e8-24a1-4b79-ab2b-bc0f6202e6ea.mov
Reduced test cases
Our navbar related style overrides are here:
https://github.com/coneno/case-web-ui/blob/master/src/scss/helpers/navbar.scss
And the navbar item is implemented here:
https://github.com/coneno/case-web-app-core/blob/master/src/components/navbar/NavbarComponents/NavbarItem.tsx
(with class names "btn nav-link nav-link-height" attached)
What change from the release might cause the displayed issue? We can make an isolated example to reproduce then, but at the moment, it's quite hard to pinpoint where this behaviour change might come from for us.
Thank you!
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
Chrome, Safari
What version of Bootstrap are you using?
5.2.1
The text was updated successfully, but these errors were encountered: