Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compute iframe parents #636

Closed
wants to merge 2 commits into from

Conversation

92thunder
Copy link
Contributor

@92thunder 92thunder commented Jan 30, 2020

Changes

  • Add iframe_outside_viewport case
  • Collect all the scrolling boxes includes iframe parents
  • Get rect considering iframe instead of target.getBoundingClientRect()

Fixed scroll-into-view/scroll-into-view-if-needed#713

Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

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

Hey, appreciate the fix! 😃 I see that my initial method of using a while(isElement) loop is starting to show its age.
After taking my time to look at your PR I realise it's going to be a challenge to refactor it to reduce bundlesize further. Without compromising on scenarios like an iframe parent that's also a scroll target, as you've solved in the getRect function. I wish we didn't need to have extra logic to support iframes, and instead keep bundlesize minimal, but I guess our hands are tied 😨
I'll be doing some maintenance on master and return to this PR and get it released later 🙂
Thanks for the contribution, stellar work! 🥇

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.

Does not scroll to element in iframe outside viewport
2 participants