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

Make the scrollAncestorsToShowRect() function take the limiter element #14599

Merged
merged 5 commits into from
Jul 18, 2023

Conversation

Dumluregn
Copy link
Contributor

Suggested merge commit message (convention)

Feature(utils): Made the scrollAncestorsToShowRect() function take the limiter element, which will stop it from scrolling further ancestors. Closes #14598.


Additional information

The code coverage was essentially provided in scrollAncestorsToShowTarget() function tests.

@Dumluregn Dumluregn requested a review from oleq July 18, 2023 08:03
{
parent,
getRect,
alignToTop,
forceScroll,
ancestorOffset = 0
ancestorOffset = 0,
limiterElement
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we add this option to scrollAncestorsToShowTarget() and use it in the document outline instead of making this helper public?

I mean, this limiterElement argument would stay there (it needs docs, BTW) but we wouldn't need to make this low-level API exportable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH this choice was purely caused by the functions signatures.

scrollAncestorsToShowTarget() has 2 params of which one is optional. I didn't want to enforce passing the nullish ancestorOffset to use limiterElement. However DO was the only place that used this function and it was passing the ancestorOffset anyways, so I guess we can go with your proposal.

@Dumluregn Dumluregn requested a review from oleq July 18, 2023 13:23
@oleq oleq merged commit a411cd7 into master Jul 18, 2023
@oleq oleq deleted the ci/3442-document-outline-limit-scrolling branch July 18, 2023 13:36
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.

Enable scrolling the ancestors up to target limiter
2 participants