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

[Virtual-scroll] reading DOM element dimension during scroll causing scroll back #17597

Closed
manzonif opened this issue Nov 4, 2019 · 3 comments · Fixed by #17727
Closed

[Virtual-scroll] reading DOM element dimension during scroll causing scroll back #17597

manzonif opened this issue Nov 4, 2019 · 3 comments · Fixed by #17727

Comments

@manzonif
Copy link
Contributor

manzonif commented Nov 4, 2019

Reproduction

https://stackblitz.com/edit/components-issue-ooljyt

this is the basic cdk-virtual-scroll example plus the below few lines of code:

  ngAfterViewChecked() {
        const x = this.elementRef.nativeElement.scrollTop;
        console.log(x);

  }

Steps to reproduce:

  1. Open in new window
  2. scroll until Item 10

Expected Behavior

Scroll to Item 11, 12 and so on.

Actual Behavior

Scroll back to Item 5

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
@manzonif
Copy link
Contributor Author

No idea how to get around this problem?

@manzonif
Copy link
Contributor Author

submitted a PR that fix this issue.

@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 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant