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
{{ message }}
Repository navigation
ViewportScroller getScrollPosition does not work in Internet Explorer聽#27957
This seems to be incorrectly feature-detected earlier in the function by BrowserViewportScroller.supportScrollRestoration, which returns true for IE11, as both window itself and window.scrollTo are defined. This, however, doesn't check for the availability of the scrollX and scrollY properties.
In-app fix: adding a polyfill in src/polyfills.ts for window.scrollX and window.scrollY can "fix" the issue (for the browser target) with the current ViewportScroller implementation.
FYI, the corresponding PR #28262 that contains the fix was merged, so I'm closing this ticket. The fix should be available once the next release (11.0.3) is published. Thank you.
Activity
skreborn commentedon Jan 7, 2019
This happens because
BrowserViewportScroller.getScrollPositionreturns with the valueswindow.scrollXandwindow.scrollY, neither of which are supported by Internet Explorer.This seems to be incorrectly feature-detected earlier in the function by
BrowserViewportScroller.supportScrollRestoration, which returnstruefor IE11, as bothwindowitself andwindow.scrollToare defined. This, however, doesn't check for the availability of thescrollXandscrollYproperties.enten commentedon Feb 28, 2019
Why not update ViewportScroller to get viewport scroll position like material2?
--
In-app fix: adding a polyfill in
src/polyfills.tsforwindow.scrollXandwindow.scrollYcan "fix" the issue (for the browser target) with the current ViewportScroller implementation.Example for IE11:
petebacondarwin commentedon May 28, 2020
It seems to me that it would be enough to use the
this.window.pageXOffsetandthis.window.pageYOffsetproperties instead.From https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#Notes
These properties are supported by IE9-11: https://developer.mozilla.org/en-US/docs/Web/API/Window/pageXOffset#Browser_compatibility
AndrewKushnir commentedon Nov 19, 2020
FYI, the corresponding PR #28262 that contains the fix was merged, so I'm closing this ticket. The fix should be available once the next release (11.0.3) is published. Thank you.
angular-automatic-lock-bot commentedon Dec 20, 2020
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.