Comments (2)
I've attempted to manipulate the divs DOM node with portalNode.element.scrollTop = 400;
but that doesn't seem to work either
from react-reverse-portal.
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.
from react-reverse-portal.
Related Issues (20)
- iframes reload from source HOT 6
- Race condition when swapping nodes between <OutPortal/>s HOT 5
- Any way to prevent unmounting of the portal contents when changing portals that aren't located within the same component? HOT 2
- Child components are re-rendered when switching their OutPortal HOT 1
- How to Create Multiple InPortals HOT 1
- Not rendering before an outPortal is used HOT 2
- Unhandled Rejection (NotFoundError): Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. HOT 9
- Giving style to intermediary div HOT 3
- How to *destroy* a portal? HOT 3
- Migrate from Travis to Github Actions? HOT 1
- Rendering portal in a new window causes error: "html" portalNodes must be used with html elements, but OutPortal is within DIV HOT 1
- Nextjs error HOT 1
- Queries around library usage HOT 1
- Doesn't work when there is nested `portals.OutPoral` HOT 6
- moving OutPortal doesn't cause unmount/mount, but *does* cause re-render HOT 2
- Props stay the same when InPortal content is hidden HOT 3
- Text field autoFocus doesn't work in a portal HOT 1
- Some non-hook function results are not preserved after conditional OutPortal HOT 2
- Support for Preact HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-reverse-portal.