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): Allow scrolling when browser supports scrollTo #38468

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Aug 14, 2020

This commit fixes a regression from "fix(common): ensure
scrollRestoration is writable (#30630)" that caused scrolling to not
happen at all in browsers that do not support scroll restoration. The
issue was that supportScrollRestoration was updated to return false
if a browser did not have a writable scrollRestoration. However, the
previous behavior was that the function would return true if
window.scrollTo was defined. Every scrolling function in the
ViewportScroller used supportScrollRestoration and, with the update
in bb88c9f, no scrolling would be
performed if a browser did not have writable scrollRestoration but
did have window.scrollTo.

Note, that this failure was detected in the saucelabs tests. IE does not
support scroll restoration so IE tests were failing.

@atscott atscott added type: bug/fix area: common Issues related to APIs in the @angular/common package area: router target: patch This PR is targeted for the next patch release labels Aug 14, 2020
@atscott atscott requested a review from josephperrott August 14, 2020 17:50
@ngbot ngbot bot added this to the needsTriage milestone Aug 14, 2020
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just one small comment to consider

packages/common/src/viewport_scroller.ts Outdated Show resolved Hide resolved
@atscott atscott force-pushed the investigatefailures branch from daaa01b to 13185cf Compare August 14, 2020 17:56
This commit fixes a regression from "fix(common): ensure
scrollRestoration is writable (angular#30630)" that caused scrolling to not
happen at all in browsers that do not support scroll restoration. The
issue was that `supportScrollRestoration` was updated to return `false`
if a browser did not have a writable `scrollRestoration`. However, the
previous behavior was that the function would return `true` if
`window.scrollTo` was defined. Every scrolling function in the
`ViewportScroller` used `supportScrollRestoration` and, with the update
in bb88c9f, no scrolling would be
performed if a browser did not have writable `scrollRestoration` but
_did_ have `window.scrollTo`.

Note, that this failure was detected in the saucelabs tests. IE does not
support scroll restoration so IE tests were failing.
@atscott atscott force-pushed the investigatefailures branch from 13185cf to 712b804 Compare August 14, 2020 18:00
@atscott
Copy link
Contributor Author

atscott commented Aug 14, 2020

presubmit

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 14, 2020
atscott added a commit that referenced this pull request Aug 14, 2020
This commit fixes a regression from "fix(common): ensure
scrollRestoration is writable (#30630)" that caused scrolling to not
happen at all in browsers that do not support scroll restoration. The
issue was that `supportScrollRestoration` was updated to return `false`
if a browser did not have a writable `scrollRestoration`. However, the
previous behavior was that the function would return `true` if
`window.scrollTo` was defined. Every scrolling function in the
`ViewportScroller` used `supportScrollRestoration` and, with the update
in bb88c9f, no scrolling would be
performed if a browser did not have writable `scrollRestoration` but
_did_ have `window.scrollTo`.

Note, that this failure was detected in the saucelabs tests. IE does not
support scroll restoration so IE tests were failing.

PR Close #38468
@atscott atscott closed this in 71079ce Aug 14, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…38468)

This commit fixes a regression from "fix(common): ensure
scrollRestoration is writable (angular#30630)" that caused scrolling to not
happen at all in browsers that do not support scroll restoration. The
issue was that `supportScrollRestoration` was updated to return `false`
if a browser did not have a writable `scrollRestoration`. However, the
previous behavior was that the function would return `true` if
`window.scrollTo` was defined. Every scrolling function in the
`ViewportScroller` used `supportScrollRestoration` and, with the update
in bb88c9f, no scrolling would be
performed if a browser did not have writable `scrollRestoration` but
_did_ have `window.scrollTo`.

Note, that this failure was detected in the saucelabs tests. IE does not
support scroll restoration so IE tests were failing.

PR Close angular#38468
@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 Sep 14, 2020
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 area: router cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants