Skip to content
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

NaN is an invalid value for the top css style property. #441

Closed
meotimdihia opened this issue May 6, 2024 · 3 comments · Fixed by #443
Closed

NaN is an invalid value for the top css style property. #441

meotimdihia opened this issue May 6, 2024 · 3 comments · Fixed by #443

Comments

@meotimdihia
Copy link

meotimdihia commented May 6, 2024

Describe the bug
The bug happen with virtua > 0.27.4 ( the bug doesn't happen on <= 0.27.4)

Screen.Recording.2024-05-06.at.12.25.42.mov

Make the browser not responsive and the console output the warning: `NaN` is an invalid value for the `top` css style property.

To Reproduce
Steps to reproduce the behavior.
Step to reproduce the bug:
1. Click the link "Scroll Restoration Page"
2. CLick the button "Make List Smaller"
3. Click the link "Home"
4.Click the link "Scroll Restoration Page"

Expected behavior
A clear and concise description of what you expected to happen.

Platform:

  • OS: Any
  • Browser: Chrome
  • Version of this package: virtua > ^0.27.4 ( the bug doesn't happen on 0.27.4(
  • Version of framework: react
@inokawa
Copy link
Owner

inokawa commented May 7, 2024

This example seems to be working as expected.
If you restore the scroll position, also you have to restore the items (that is not documented though).
I refactored the internal cache at 0.28.0. The example might work with older version but it's unexpected behavior.

@inokawa
Copy link
Owner

inokawa commented May 7, 2024

...or maybe we should accept cache with shorter length. It would be safer.

@inokawa
Copy link
Owner

inokawa commented May 7, 2024

Should be fixed in 0.30.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants