-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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(vue-app): check for Page.options before looking within #8612
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #8612 +/- ##
=======================================
Coverage 66.02% 66.02%
=======================================
Files 92 92
Lines 4009 4009
Branches 1103 1103
=======================================
Hits 2647 2647
Misses 1095 1095
Partials 267 267
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@@ -31,9 +31,9 @@ export default function (to, from, savedPosition) { | |||
// Scroll to the top of the page if... | |||
if ( | |||
// One of the children set `scrollToTop` | |||
(Pages.some(Page => Page.options.scrollToTop) || | |||
(Pages.some(Page => Page.options && Page.options.scrollToTop) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use this?
(Pages.some(Page => Page.options && Page.options.scrollToTop) || | |
(Pages.some(Page => Page.options?.scrollToTop) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may add extra polyfill if user is not using optional chaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this and I may make some refactoring to this file after the fix
Types of changes
Description
Difficult to reproduce the issue but the fix is lightweight.
closes #8234
Checklist: