List: broken rendering if scrolling while `display: none` is set + not scrolling to the right element
See original GitHub issueSteps to reproduce:
- Have a list
- Scroll it
- Filter it
- Even if the new filtered list is not long enough to be scrollable
react-window
still thinks that it is scrolled, and some rows might not get rendered
I’ve made a video showcasing this here.
Until this is fixed I think I’ll either have to render the list twice by forcing an update of scrollOffset
by triggering a scroll
event, or manually setting scrollTop = 0
before each filtering round or something.
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (5 by maintainers)
Top Results From Across the Web
Prevent body scrolling but allow overlay scrolling
The div inside the overlay is in position: static so the vertical scrollbar is related to that element. This is resulting in a...
Read more >overscroll-behavior - CSS: Cascading Style Sheets | MDN
The overscroll-behavior CSS property sets what a browser does when reaching the boundary of a scrolling area.
Read more >Element size and scrolling - The Modern JavaScript Tutorial
Properties scrollLeft/scrollTop are the width/height of the hidden, scrolled out part of the element. On the picture below we can see ...
Read more >content-visibility | CSS-Tricks
Think of it sort of like lazy loading in the sense that an off-screen element's children are not rendered until they enter the...
Read more >.scroll() | jQuery API Documentation
The scroll event is sent to an element when the user scrolls to a different place in the element. It applies to window...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like something funky is going on with your params (like maybe you aren’t updating the
itemCount
or something). Unless you can provide a repro, I can’t really help here.I’m going to close this for now because I don’t like keeping unactionable issues open. We can keep talking though, and I’ll be happy to look at a repro if you can share one.
I’m having a similar problem (not the exact same one, but still related to
display: none
).I have a toggle-Link which shows and hides a container with
display: none
anddisplay: block
.On the same page I have an Input which triggers a live search after each keystroke and therefor updates the state.
If the toggle is closed, the page keeps scrolling to the top after each keystroke. If the toggle is closed, the page doesn’t scroll and the Input stays at the same position (latter is the expected and wanted behavior).