Skip to content

fix detecting scroll behavior in edge #17960

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

Closed
wants to merge 2 commits into from
Closed

fix detecting scroll behavior in edge #17960

wants to merge 2 commits into from

Conversation

SteveRusin
Copy link

'scrollBehavior' in document.documentElement!.style

returns true after using overlay due to this code. This check returns false for an edge before opening modal

from MDN

If you set a property to undefined but do not delete it, the in operator returns true for that property.

I faced this issue in production in my app. I'm using virtual scrolling for mat-select in our modal.
After trying to open select and restore the scrolling index of the selected item app crashes in the edge.
Please have a look at this issue.

This is my code to restore the index

  @ViewChild(CdkVirtualScrollViewport, { static: true }) vsViewport: CdkVirtualScrollViewport;
/// indx => index of the selected item
this.vsViewport.scrollToIndex(indx);

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla label Dec 13, 2019
@crisbeto
Copy link
Member

There's a fix for this already in #17223.

@SteveRusin SteveRusin closed this Dec 16, 2019
@SteveRusin SteveRusin deleted the fix-detecting-scroll-in-edge branch December 16, 2019 09:33
@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 Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants