Skip to content

fix(virtual-core): loosen approxEqual to allow 1px difference#995

Merged
piecyk merged 2 commits intoTanStack:mainfrom
piecyk:fix/virtual-scroll-approx-equal
May 5, 2025
Merged

fix(virtual-core): loosen approxEqual to allow 1px difference#995
piecyk merged 2 commits intoTanStack:mainfrom
piecyk:fix/virtual-scroll-approx-equal

Conversation

@piecyk
Copy link
Copy Markdown
Collaborator

@piecyk piecyk commented May 5, 2025

fixes #980

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2025

🦋 Changeset detected

Latest commit: e538844

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tanstack/virtual-core Patch
@tanstack/angular-virtual Patch
@tanstack/lit-virtual Patch
@tanstack/react-virtual Patch
@tanstack/solid-virtual Patch
@tanstack/svelte-virtual Patch
@tanstack/vue-virtual Patch

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 5, 2025

View your CI Pipeline Execution ↗ for commit e538844.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 25s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-05 17:33:20 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2025

More templates

@tanstack/angular-virtual

npm i https://pkg.pr.new/@tanstack/angular-virtual@995

@tanstack/lit-virtual

npm i https://pkg.pr.new/@tanstack/lit-virtual@995

@tanstack/solid-virtual

npm i https://pkg.pr.new/@tanstack/solid-virtual@995

@tanstack/react-virtual

npm i https://pkg.pr.new/@tanstack/react-virtual@995

@tanstack/virtual-core

npm i https://pkg.pr.new/@tanstack/virtual-core@995

@tanstack/svelte-virtual

npm i https://pkg.pr.new/@tanstack/svelte-virtual@995

@tanstack/vue-virtual

npm i https://pkg.pr.new/@tanstack/vue-virtual@995

commit: e538844

@piecyk piecyk merged commit 60719f6 into TanStack:main May 5, 2025
4 checks passed
@github-actions github-actions Bot mentioned this pull request May 5, 2025

if (!approxEqual(latestOffset, this.getScrollOffset())) {
const currentScrollOffset = this.getScrollOffset()
if (!approxEqual(latestOffset, currentScrollOffset)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there still a chance to get infinite loop

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have something specific in mind?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for any given scrollToIndex we want to set some kind of counter, and break recursion when this counter is reach some limit, kinda dead loop detector

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 this pull request may close these issues.

scrollToIndex blocks scrolling after execution in Safari

2 participants