-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to react-virtual 3.0.1 #348
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@iFreilicht hey, just curious: |
Hmmm, I'm not really sure, but my assumption is that the dependency From my testing, this change is ready, but I didn't actually use it in a project after all. I think I wanted to use spectacle with node 21 or something, and this was the blocker, but in the end I just decided to use node 20. |
@timc1 we need this to be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a slight regression in expected behavior here – when navigating back, the scroll position is incorrect:
Screen.Recording.2024-02-04.at.1.28.16.PM.mov
Ah thank you, I fixed this now! Unfortunately, it seems |
react-virtual is now available as v3 and published under @tanstack/react-virtual. The old version will not receive updates anymore, see cloudscape-design/components#1765 (comment). Fixes timc1#330
I have this even without the react-virtual update. I'd say it's a separate ticket |
Ah that's good to know! @timc1, if you don't like my workaround, I'll happily revert it so this can be fixed in a separate PR. |
@pyyding can you share a screen cap of that behavior with the current version? |
Sure! This demo shows it sometimes doesn't open the menu scrolled to top and sometimes when navigating back. I briefly went over the source code trying to find the bug but it's not as obvious as I'd initially expected. Feel free to share some pointers! Because if it doesn't magically get fixed, I'm gonna have to deepdive into it soonish. kbar-scroll-demo.mov |
@pyyding awesome! And is this during dev or production? |
@pyyding The fix to this specific bug is here: https://github.com/timc1/kbar/pull/348/files#diff-e82a08a30f41d6167d79fe54b58c564bbc4d5ddb301aecbf6de659adcc50888dR98-R109 My theory is that the issue is caused by the fact that scrolling the list back to the top and resizing the list so it is visible again are two separate effects, the order of which is undefined. If the resize happens first, scrolling works fine, but if the list is still invisible, scrolling won't work. The fix delays scrolling so it always happens after resizing. I'm not entirely sure why the scroll position moves in the first place, though. Maybe it would be better to fix that. |
@timc1 yeah it was only in dev |
Although it's a helpful tool, the warning in the installation may not help users adopt the library (users can be afraid of it or even wonder if it is still maintained). As it seems not to have any side effects, is it possible to publish a new version? |
Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant, do not close |
Bad bot |
react-virtual is now available as v3 and published under @tanstack/react-virtual. The old version will not receive updates anymore, see cloudscape-design/components#1765 (comment).
Fixes #330
This required a few more changes than I initially anticipated, but from what I can tell this works perfectly now.
There is a new
estimateSize
function, react-virtual v3 requires specifying that even if only dynamically-sized elements are used. The docs recommend:AFAICT, this shouldn't matter for kbar and I don't think it makes sense to expose this value as a configurable prop.