-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Pass through extra arguments to scrollTo #2069 #2096
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
Conversation
Adds smooth scrolling option to scrollBehavior position
Thanks for the PR but It will be better to pass any extra arguments to build up an object, so the user can pass the original |
So your saying something like this or did I miss understand your comment? |
Yes, it's something like that
On Fri, Mar 9, 2018 at 11:21 AM Nurdism ***@***.***> wrote:
So your saying something like this or did I miss understand your comment?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2096 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoicW8bAiMnWDbuznHFSbrjLQtFJYX2ks5tcle2gaJpZM4Sj_Qm>
.
--
Eduardo San Martin Morote
|
I'm wondering if it would be better to wrap it with a |
Hi there! It would be nice if this PR gets merged, is something holding this back? I can help if needed (was going to submit a PR but found this one). |
window.scrollTo(position.x, position.y) | ||
const docEl: any = document.documentElement | ||
if ('scrollBehavior' in docEl.style) { | ||
window.scrollTo({ top: position.y, left: position.x, behavior: isObject && typeof shouldScroll.behavior === 'string' ? shouldScroll.behavior : 'auto' }) |
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 do
behavior: (isObject && shouldScroll.behavior) || 'auto'
the user should be responsible for passing the correct type of value
There is a problem with the repository so I will add the change locally |
This is a PR for issue #2069
Adds smooth scrolling option to scrollBehavior position.