Repository navigation
fix: read the current axis in the window initialOffset default - #1395
Conversation
🦋 Changeset detectedLatest commit: 6fc2ed8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
View your CI Pipeline Execution ↗ for commit 6fc2ed8
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
piecyk
left a comment
There was a problem hiding this comment.
Nice, thanks @harrismalik! Checked it locally, core, lit and svelte all green, and the two new axis tests fail on main without the adapter change, so they cover the bug.
Went through the other adapters too, they rebuild the callback from the current options, so only Lit and Svelte needed it. The docs note about not calling getVirtualItems from the callback is a good call.
Pushed one small commit on top, 6fc2ed8: the Marko input types still said () => number, so Marko users couldn't use the new argument. Types, docs table and changeset only.
CI is green, good to merge 🚀
🎯 Changes
Fixes #1390
Core now passes the virtualizer to
initialOffset, and the Lit and Svelte window virtualizers use it to read the currenthorizontaloption instead of the one captured at creation. Callbacks that take no parameters still type-check. The other adapters already read the current option.The Lit and Svelte tests change the axis while the list is disabled, with different
scrollXandscrollY, then enable it again; they also check that an explicitinitialOffsetstill wins. The core test checks that the callback sees the current options.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit