react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

chore: Revert "Revert "fix: scrollIntoView should respect scroll-margin (#8715)""

Open nwidynski opened this issue 1 month ago • 2 comments

This PR refactors scrollIntoView and scrollIntoViewport to support scrollMargin, while working around the regressions mentioned in https://github.com/adobe/react-spectrum/issues/8689#issuecomment-3429792206. Additionally, a new inline & block option for alignment of a container element has been added.

By leveraging bounding rectangles, the internal calculations are now streamlined with DOMLayoutDelegate and significantly simplified.

✅ 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:

nwidynski avatar Nov 04 '25 23:11 nwidynski