2 ms·
I think you might have misunderstood the situation. Popper supports putting popper elements somewhere else in the DOM, but that’s not their general recommendat
by chrismorgan 4y ago
I think you might have misunderstood the situation.
Popper supports putting popper elements somewhere else in the DOM, but that’s not their general recommendation (https://popper.js.org/docs/v2/performance/#attaching-elements-to-the-dom https://popper.js.org/docs/v2/performance/#attaching-element...).
React Aria puts its popups in such a separate place in the DOM like you’re saying.
But the part I and the parent were remarking upon is what you do about scrolling.
Popper’s (default) answer is “recalculate the preferred position [and size, I think?] on every scroll event”. This is perfectly fine, and sometimes preferable.
React Aria’s answer is “position once and then prevent scrolling”. This matches all platforms’ conventions for these sorts of elements, it’s just that the way they’ve implemented it has problems, problems that may be unavoidable at present.
- Rapzid 4y agoIs it possible the doc page is just not laid out well and that's causing weird interactions with how the component tries to stop scrolling? I imagine it also tries to stop in the nearest scroll port, which just happens to be the root here. In any case I'm sure they will fix it if you open an issue against it..