-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
fix(virtual-core): fix total size calculation for single item in multi-lane #967
Conversation
|
Thanks, @greenblues1190! Let's add the test. Overall, the tests need some attention. The plan is to refactor the current unit tests a bit and add browser testing using Playwright. |
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.
If this is an off-by-one, then the condition on L1165 also needs to be adjusted (it's essentially the same loop.)
View your CI Pipeline Execution ↗ for commit d82f15f.
☁️ Nx Cloud last updated this comment at |
This is a follow-up to #961. The original issue still occurs when there's only one item in a multi-lane layout.
This PR changes the loop condition in
getTotalSize()
to handle cases where only one item exists in multi-lane. The previous condition skipped the loop whenendIndex === 0
, which caused the total size to be incorrectly calculated as 0.I used the following test to verify the fix locally:
This is a fairly specific edge case, so I didn’t include the test in the commit.
Happy to add it if you think it’d be useful to include in the suite!
Fixes #963