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(common): viewport scroller not finding elements inside the shadow DOM #41644

Closed

Conversation

crisbeto
Copy link
Member

The ViewportScroller figures out which element to scroll into view using document.getElementById. The problem is that it won't find elements inside the shadow DOM.

These changes add some extra logic that goes through all the shadow roots to look for the element.

Fixes #41470.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer area: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release labels Apr 15, 2021
@ngbot ngbot bot modified the milestone: Backlog Apr 15, 2021
@google-cla google-cla bot added the cla: yes label Apr 15, 2021
@pullapprove pullapprove bot requested a review from atscott April 15, 2021 14:40
@crisbeto crisbeto force-pushed the 41470/viewport-scroller-shadow-dom branch from a6d7eab to 90fe285 Compare April 15, 2021 14:48
… DOM

The `ViewportScroller` figures out which element to scroll into view using `document.getElementById`. The problem is that it won't find elements inside the shadow DOM.

These changes add some extra logic that goes through all the shadow roots to look for the element.

Fixes angular#41470.
@crisbeto crisbeto force-pushed the 41470/viewport-scroller-shadow-dom branch from 90fe285 to 7f48e8f Compare April 15, 2021 15:01
@atscott
Copy link
Contributor

atscott commented Apr 15, 2021

presubmit

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 15, 2021
@atscott atscott removed the action: presubmit The PR is in need of a google3 presubmit label Apr 15, 2021
AndrewKushnir pushed a commit that referenced this pull request Apr 15, 2021
… DOM (#41644)

The `ViewportScroller` figures out which element to scroll into view using `document.getElementById`. The problem is that it won't find elements inside the shadow DOM.

These changes add some extra logic that goes through all the shadow roots to look for the element.

Fixes #41470.

PR Close #41644
AndrewKushnir pushed a commit that referenced this pull request Apr 15, 2021
… DOM (#41644)

The `ViewportScroller` figures out which element to scroll into view using `document.getElementById`. The problem is that it won't find elements inside the shadow DOM.

These changes add some extra logic that goes through all the shadow roots to look for the element.

Fixes #41470.

PR Close #41644
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: common Issues related to APIs in the @angular/common package cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

anchorScrolling: 'enabled' does not work when using ViewEncapsulation.ShadowDom
2 participants