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

[v5-b3] Using a select menu in a dropdown in a navbar collapses the dropdown menu #33592

Closed
lenormf opened this issue Apr 9, 2021 · 5 comments · Fixed by #33643
Closed

[v5-b3] Using a select menu in a dropdown in a navbar collapses the dropdown menu #33592

lenormf opened this issue Apr 9, 2021 · 5 comments · Fixed by #33643
Labels
Projects

Comments

@lenormf
Copy link

lenormf commented Apr 9, 2021

Hi,

Here's a reproducer:

<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <ul class="navbar-nav me-auto mb-2 mb-lg-0">
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
        Dropdown
      </a>
      <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
        <li>
          <select class="form-select" aria-label="Default select example">
            <option selected>Open this select menu</option>
            <option value="1">One</option>
          </select>
        </li>
      </ul>
    </li>
  </ul>
</nav>
  • expand the dropdown menu by clicking on it
  • select an item in the menu (e.g. "One")

Outcome: the dropdown menu gets collapsed upon selecting an item
Expected: the dropdown menu remains open, to allow for example submitting the form that the select input is a part of

I haven't tried outside of a navbar (apparently Popper is not needed for dropdowns in navbars?).

HTH.

@mdo
Copy link
Member

mdo commented Apr 14, 2021

Seems to work for me? https://codepen.io/emdeoh/pen/oNBdbZm

@mdo mdo closed this as completed Apr 14, 2021
@lenormf
Copy link
Author

lenormf commented Apr 14, 2021

I can reproduce the issue on the CodePen link.

My browser is Firefox v87.

@alpadev
Copy link
Contributor

alpadev commented Apr 14, 2021

Yeah it only does this in Firefox.. For some reason the event.target is option not the select like in other browsers..

@mdo should I reopen and fix that?

@mdo
Copy link
Member

mdo commented Apr 14, 2021

Yes please, @alpadev! <3

@lenormf
Copy link
Author

lenormf commented Apr 18, 2021

Thanks a lot @alpadev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v5.0.0
  
Done
4 participants