Popper.js 2 - append to body
Asked Answered
H

0

7

In Popper.js 2 documentation I see a small hint that appending to the body is supported:

https://popper.js.org/docs/v2/performance/#attaching-elements-to-the-dom

However, I cannot find any example of how that is done.

Can someone please provide an example that appends Popper.js version 2 popup to body?

Harrell answered 27/4, 2022 at 15:37 Comment(3)
For future readers: they mean that it's supported that popper element may be somewhere else in the DOM, not necessary next to the reference element. As for actual functionality, Popper doesn't handle this, it will not place popper element somewhere else in the DOM so you should handle this on your own.Elated
@Elated have you got an example?Wuhan
I don't have a ready example but the idea is that your popup element can be placed directly inside body tag or somewhere else, popper will handle this. You don't need to put both reference element and popup element together inside the same parent.Elated

© 2022 - 2024 — McMap. All rights reserved.