Comments (6)
Invoking scrollRef.current.scrollTo(0, 0)
at the appropriate moment (maybe after the loading is complete?) should do the trick.
from react-bottom-scroll-listener.
Hmm... Are you saying the ref changes and the scroll listener stops working?
from react-bottom-scroll-listener.
No it's not stops working but my problem is when you have a table with a filter, after filtering your table is reloaded but I don't want it to scroll to the position in the past before filtering(scrollTop must be 0 in this case), so how can I set scrollTop to 0?
from react-bottom-scroll-listener.
If you simply need to scroll the page to the top again you can use window.scrollTo(0, 0)
.
from react-bottom-scroll-listener.
If you are scrolling inside a specific container you should be able to use .scrollTo
on the ref as well.
from react-bottom-scroll-listener.
<BottomScrollListener]([url](url)) onBottom={props.onFetchMore} offset={200}> {scrollRef => { return ( <TableContainer ref={scrollRef} style={{ height: height - actionHeight - 5, maxWidth: width }} > </TableContainer> ); }} </BottomScrollListener>
Maybe for this component, can you tell me how I can use the .scrollTo in this specific container?
from react-bottom-scroll-listener.
Related Issues (20)
- listener event is not triggered when page zoom is greater than 100% HOT 11
- Consider leading:true on debounce HOT 4
- useBottomScrollListener useEffect runs before ref has been set HOT 4
- Useless debounce HOT 3
- Leaving bottom state HOT 4
- Have component use hooks implementation
- Specific container behaviour HOT 2
- onBottom not call when container too small to be scrallable HOT 7
- Warning: React.createElement: type is invalid. Got Object. HOT 2
- use named options for hook HOT 2
- Component specific container callback does not fire HOT 8
- another option as object not function parameter HOT 2
- Adding wheel event listener as well to react in a similar manner as for scrolling HOT 2
- Bottom Scroll Listener with tabs HOT 6
- notOnBottom properity HOT 3
- Listener for "Scroll To Top" event. HOT 1
- Please add threshold options HOT 2
- use it in iframe HOT 2
- Issue on 3840 x 2160 resolution HOT 2
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-bottom-scroll-listener.