Dropdown in navbar with white-space nowrap - BS4

最后都变了- 提交于 2020-01-06 04:31:46

问题


Using Vue-bootstrap dropdown component: b-nav-item-dropdown

I have an issue when using dropdown element in Navbar with horizontal scrolling when client has a small screen resolution.

Code

    <b-nav class="justify-content-end">
      <b-nav-item class="nav__map" active>First item</b-nav-item>
      <b-nav-item class="nav__help">Second item</b-nav-item>
      <b-nav-item-dropdown class="nav__city" text="New-York" extra-toggle-classes="nav-link-custom" right>
        <b-dropdown-item>New-York</b-dropdown-item>
        <b-dropdown-item>San Francisco</b-dropdown-item>
      </b-nav-item-dropdown>
    </b-nav>

CSS

  .nav {
    white-space: nowrap;
    overflow-x: auto;
    display: inherit;

    .nav-item {
      display: inline-block;
    }
  }

Because of white-space: nowrap when I click on a dropdown, that popup goes behind all elements:

I've tried to play with z-index, but had no success.

来源:https://stackoverflow.com/questions/52163551/dropdown-in-navbar-with-white-space-nowrap-bs4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!