You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When checking the scroll position in ngOnDestroy(), it always returns 0
Expected/desired behavior
Should return the scroll position
when ngOnDestroy is called, the underlying element is no longer part of the document, so it's scroll position was reset by the browser.
a higher level event would be better to capture the scroll position. if you are using router then you can listen via CanDeactivate and capture the position there.
I'm submitting a ...
Current behavior
When checking the scroll position in ngOnDestroy(), it always returns 0
Expected/desired behavior
Should return the scroll position
Reproduction of the problem
http://plnkr.co/edit/OCdhEonzrkpRaT8iYB0i?p=preview
Check the console for the scroll position when clicking a button and when switching to the about menu
What is the expected behavior?
Return the scroll position
What is the motivation / use case for changing the behavior?
Would like to save the scroll position before the component is destroyed
Please tell us about your environment:
2.0.0-rc.5
Chrome 52.0.2743.116 m
TypeScript
The text was updated successfully, but these errors were encountered: