Force Bootstrap dropdown menu to always display at the bottom and allow it go offscreen

前端 未结 3 717
谎友^
谎友^ 2021-02-07 02:38

When there is no room at the bottom of the viewport to fit dropdown menu, it is displayed at the top of its dropdown button. Is it possible alter this behavior and make dropdown

3条回答
  •  忘了有多久
    2021-02-07 02:45

    For Bootstrap ≥ 4.1

    Completely disable Popper.js dynamic positioning by setting data-display="static" on dropdown-toggle element (button or link) .

    From Bootstrap Docs > Dropdowns: Options:

    By default, we use Popper.js for dynamic positioning. Disable this with static.

    .window {
      height: 8em;
      overflow: auto;
      margin: 1em;
      padding: 1em;
      border: 10px solid #DFEAF2;
    }
    
    
    
    
    

提交回复
热议问题