React-popper: How to handle popper when there is an header in position fixed

Created on 13 Sep 2020  路  1Comment  路  Source: popperjs/react-popper

Reproduction demo

Screenshot 2020-09-13 at 12 30 00

Steps to reproduce the problem

It's so easy to reproduce it.
Take a top position fixed element and an element that scrolls inside the page referred to the popper (top placement).
When popper is near the top zone of the page it collides with fixed element (it can be over or below the fixed element for example depending to z-index).

What is the expected behavior?

I want the popper knows that he cannot be in the former top px of the page and when it collides with header its replacement is bottom.

Packages versions

  • Popper.js: 2.4.4
  • react-popper: 2.2.3

Most helpful comment

Ciao, you can set the padding option in the preventOverflow modifier.

https://popper.js.org/docs/v2/modifiers/prevent-overflow/#padding

>All comments

Ciao, you can set the padding option in the preventOverflow modifier.

https://popper.js.org/docs/v2/modifiers/prevent-overflow/#padding

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alarstyle picture alarstyle  路  6Comments

bgando picture bgando  路  3Comments

craigsketchley picture craigsketchley  路  3Comments

websitesca picture websitesca  路  5Comments

linusthe3rd picture linusthe3rd  路  4Comments