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. |
soren121
left a comment
There was a problem hiding this comment.
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