0

I'm working on a project on Angular 18 with Bootstrap 5.3 and I'm currently struggling with hovering in menu here is an example:

In Firefox, as you can see, it only change half the background:

As you can see it only change half the background

Here is the markup for that part:

<h5>Starter Equipment Id</h5>

<select formControlName="StarterEquipmentId" class="form-select ">
  <option *ngFor="let starterEquipement of starterEquipementIdOptions" [value]="starterEquipement.value"> {{starterEquipement.label}}</option>
</select>

But in Edge it doesn't encounter such issue - expected behavior: hovering changing the full tile of dropdown menu:

Edge with the expected behavior: hovering changing the full tile of dropdown menu

However the bootstrap doc state this:

"Custom menus need only a custom class, .form-select to trigger the custom styles. Custom styles are limited to the ’s initial appearance and cannot modify the s due to browser limitations."

So I guess I'm ducked but I wanted to know if there is a known work around through bootstrap, and if not what kind of add-on can I use to not make that project a 30min download with npm when I'll take this project from somewhere else?

Edit: I tried adding into the CSS:

.navLi:hover .dropdown-toggle {
      color:black;
}

.navLi:hover {
   background-color:white;
}

Without success, and this didn't work either:

option:hover {
    background-color: #636363;
    width: 100%;
}
 
.form-select:hover {
    background-color: #636363;
    width: 100%;
}
1
  • 1
    This is a known Firefox limitation with 'select' elements—it's even mentioned in the Bootstrap 5 docs. Native dropdowns can't be fully styled across all browsers. If you need full control over appearance (like background on hover), consider using a plugin like Select2 select2.org. It works well with Bootstrap 5 and supports custom styling. Alternatively, you could build a custom dropdown using Bootstrap’s Dropdown component. getbootstrap.com/docs/5.3/components/dropdowns Commented May 12 at 10:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.