Several issues when filtering list from long to shorter (or short to longer)
See original GitHub issueBug Report
Describe the Bug
Displaying a short list (81 entries) after a long list (830 entries) skips all but two (or a few) entries of shorter list and introduces excess free space before items displayed. resetScroll
is enabled and itemCount
managed as local state.
This only happens when first (longer) list was scrolled down for a few pages.
How to Reproduce
Usage:
const [itemCount, setItemCount] = React.useState(entries.length)
const { outerRef, innerRef, items, scrollToItem } = useVirtual({
itemCount,
resetScroll: true
})
React.useEffect(() => {
setItemCount(entries.length)
}, [entries])
CodeSandbox Link
I’m working on a CodeSandbox which reproduces this behavior. This will take a few days.
Expected Behavior
Second (shorter) list is displayed with first entry at the top (provided resetScroll
is working as intended).
Screenshots
Your Environment
- MacBook Pro (15-inch, 2017)
- macOS 11.5.2 (Big Sur)
- Electron 13.1.6
process.versions = {
"node": "14.16.0",
"v8": "9.1.269.36-electron.0",
"uv": "1.40.0",
"zlib": "1.2.11",
"brotli": "1.0.9",
"ares": "1.16.1",
"modules": "89",
"nghttp2": "1.41.0",
"napi": "7",
"llhttp": "2.1.3",
"openssl": "1.1.1",
"icu": "68.1",
"unicode": "13.0",
"electron": "13.1.6",
"chrome": "91.0.4472.124"
}
Additional Information
N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
excel, filter drop window too small - Microsoft Community Hub
I use a DELL XPS with 4K monitor and I have the following issue. When I open the drop down window on a...
Read more >Excel filtering very slow - Super User
It takes around 5 seconds to filter any column for any keyword. Which is pretty long because this sheet gets filtered a lot...
Read more >How to Filter a List in Python? - Finxter
All elements that are smaller than 10 and larger than 0 are included in the filtered list. Thus, only one element 3 remains....
Read more >Filter a list of items from a long long list | wmfexcel
If you need to filter for a list of items (strings) regardless position in the source data, i.e. partial match, you may use...
Read more >Longer object length is not a multiple of shorter object length?
Yes, this is something that you should worry about. Check the length of your objects with nrow(). R can auto-replicate objects so that...
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
@wellyshen Thank you! Looks good so far. We will test extensively in the coming days. Fingers crossed! 🤞
Yes. I slightly modified https://codesandbox.io/s/cocky-microservice-45702
Try this to reproduce issue 2: