-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
[Proposal] center elements for scrollTo #398
Comments
I have checked the APIs.
Perfect solution you can add later is scrolling element to bottom 1/3 of the screen and then showing tooltip in the top 2/3 of the screen. What do you think? |
If it is easy to implement, would you like to submit a PR for it? I think having scrollTo accept |
Here: #401 I just finished but now I found out that scrollIntoViewOptions is not very vell supported. Safari still does not support it. btw there is polyfill http://iamdustan.com/smoothscroll/ not sure what to do. |
We can use the polyfill. I will work on this implementation. |
This should enable users to pass options like `scrollTo: { behavior: 'smooth', block: 'center' },` which will change the scrolling behavior to center the object and to scroll smoothly. These options come from https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView The `behavior` option is not supported in Safari or IE, so we added a polyfill for them. Closes #398 Closes #401
This should enable users to pass options like `scrollTo: { behavior: 'smooth', block: 'center' },` which will change the scrolling behavior to center the object and to scroll smoothly. These options come from https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView The `behavior` option is not supported in Safari or IE, so we added a polyfill for them. Closes #398 Closes #401
Currently, we use https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView with the default options, which scrolls until the element is aligned with the top of the viewport. This is configurable, and there appears to be an option where the element is centered instead. Perhaps centered would be a more sane default, and not so extreme? We could also make this configurable and allow the user to pass
top
,bottom
,center
etc. or possible let them pass options directly to the call toscrollIntoView
.@chuckcarpenter thoughts?
cc @hheexx
The text was updated successfully, but these errors were encountered: