You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately I think this is unavoidable. React-reverse-portal is just moving the DOM node in and out of the DOM, but it sounds like many browsers reset the scroll position in any case where an element leaves the DOM. I don't think there's anything we can do to work around that here I'm afraid. Even if we automatically tracked & restored the scroll position for the top-level element, this would still affect the scroll state of node nested deeply within content.
To maintain scroll state like this, you'll have to track and restore that state using React itself somewhere else.
If you do have any suggestions to fix this though, I'm all ears! PRs very welcome.
You can see here: https://codesandbox.io/s/vigilant-platform-xy6onk?file=/src/index.tsx
Expected: scroll position maintained when switching outportals
Actual: scroll position resets to top
The text was updated successfully, but these errors were encountered: