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

feat(scroll): dd behavior support on scrollBehavior #3351

Merged
merged 2 commits into from Oct 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/util/scroll.js
Expand Up @@ -160,6 +160,15 @@ function scrollToPosition (shouldScroll, position) {
}

if (position) {
window.scrollTo(position.x, position.y)
// $flow-disable-line
if ('scrollBehavior' in document.documentElement.style) {
window.scrollTo({
left: position.x,
top: position.y,
behavior: shouldScroll.behaviour || 'auto'
posva marked this conversation as resolved.
Show resolved Hide resolved
})
} else {
window.scrollTo(position.x, position.y)
}
}
}