question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested poppers in separate DOM contexts not updating position

See original GitHub issue

CodeSandbox demo

https://codesandbox.io/s/practical-jepsen-lw8s9

Steps to reproduce the problem

  1. Scroll down to the first reference element, “menuAnchor”
  2. Click on “menuAnchor” to open the first popper
  3. Click on “subMenuAnchor” to open the next popper
  4. Scroll the page and the nested popper’s position does not update with it’s reference element (“subMenuAnchor”)

What is the expected behavior?

The nested poppers’ position should update with the reference element as the page is scrolled.

What went wrong?

Removing position: absolute or overflow: scroll from the parent div is a workaround.

Any other comments?

Original react-popper issue: https://github.com/popperjs/react-popper/issues/412

Kapture 2021-03-24 at 17 39 47

Package versions

@popperjs/core: 2.9.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
FezVrastacommented, Jun 17, 2021

What @zbrogz outlined is the most likely cause, one should understand why the function is not returning all the relevant scroll parents and fix it.

If somebody created a PR with a failing test it could be used to help others write a solution.

0reactions
atomikscommented, Dec 9, 2021

Hi, we’re closing all feature requests related to Popper as it is entering low maintenance mode. All feature requests should now relate to the new package, Floating UI!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested poppers in separate DOM contexts not updating position
It looks like we are forgetting to add an event listener on the container. If you resize the page when the two menus...
Read more >
Developers - Nested poppers in separate DOM contexts not ...
... the first popper; Click on "subMenuAnchor" to open the next popper; Scroll the page and the nested popper's position does not update...
Read more >
Popper - Tooltip & Popover Positioning Engine
Position updates take less than a millisecond on average devices. Popper doesn't debounce the positioning updates of the tooltip to the point where...
Read more >
MATERIAL-UI React - Popper of another Popper
I'm working on a calendar app. The problem: clicking popper of a popper closes both poppers, because it fires the click outside event...
Read more >
Popovers · Bootstrap v5.0
Popovers rely on the 3rd party library Popper for positioning. ... Popovers can be triggered thanks to an element inside a shadow DOM....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found