Skip to content

Conversation

@piecyk
Copy link
Contributor

@piecyk piecyk commented Feb 4, 2025

Closes #7716

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Copy link

@hshoja hshoja left a comment

Choose a reason for hiding this comment

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

Looks great, tested with tanstack virtuliazer and gridlist from react aria 👍🏼

@reidbarber
Copy link
Member

Thanks for the PR! Is there an existing story we can test this with? If not, could you create a new one?

@piecyk
Copy link
Contributor Author

piecyk commented Feb 6, 2025

Thanks for the PR! Is there an existing story we can test this with? If not, could you create a new one?

@reidbarber I couldn't find an existing story that demonstrates this issue, so I created a simple example with reproducible steps. Please check it out https://stackblitz.com/edit/vitejs-vite-zmdnq3jq.

reidbarber
reidbarber previously approved these changes Feb 7, 2025
child = child.offsetParent as HTMLElement;
}
return sum;
let childRect = child.getBoundingClientRect();
Copy link
Member

Choose a reason for hiding this comment

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

We're a little nervous about this change. We think it's missing some cases. Looking at some other libraries, there is a fair amount of complexity in determining this. For example https://www.npmjs.com/package/compute-scroll-into-view

We might be able to use this library, though are reluctant to bring in the size increase. So the thing we need to prove is that this change is "enough" for our use cases or decide we're ok with the size increase.

@uhyo
Copy link

uhyo commented Dec 4, 2025

@snowystinger Hello! Can we get a chance to get this merged?

I just hit the issue when I tried to use DatePicker inside a virtually scrolled container. I really need this fix.

So the thing we need to prove is that this change is "enough" for our use cases

I understand this concern, but I would like to emphasize that the current implementation is actually broken in some sense. The new getBoundingClientRect-based approach might possibly not be perfect, but its intent looks obvious; it seems clearly better than the current naive offsetLeft/offsetTop accumulation approach.

I'd appreciate if you could revisit this change.

@piecyk Thank you for the fix!

@snowystinger
Copy link
Member

Thanks, I'll bump with the team to see if we can more concretely define what "enough" means. If anyone has any ideas on how to prove this, we'd welcome the ideas

Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

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

Approving for testing. We'll see if we find any regressions.

Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

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

approving for testing

@devongovett devongovett added this pull request to the merge queue Jan 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2026
@devongovett devongovett added this pull request to the merge queue Jan 16, 2026
Merged via the queue into adobe:main with commit 4a815c3 Jan 16, 2026
32 checks passed
@yihuiliao yihuiliao added RAC and removed RAC labels Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect offset calculation for elements positioned with transform: translate() in scrollIntoView

7 participants