Nebula
Nebula copied to clipboard
Update Nebula scrollTo function to include native scrollIntoView (🟩 fully supported now)
Use native scrollIntoView()
when available, and possibly even scrollIntoViewIfNeeded()
when supported.
My initial thought is to update nebulaScrollTo()
(maybe a new parameter?), but might want to just update when it's called to use these instead (when appropriate)- not planning on removing nebulaScrollTo()
.
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded
Actually getting pretty close to full support: https://caniuse.com/#feat=scrollintoview
el.scrollIntoView({
behavior: 'smooth'
})
Note: Safari does not support the smooth
behavior.
Safari 14 also does not support smooth
. This could begin to be implemented anytime now just without the behavior
parameter– or just test if that is just ignored and if so keep it in.
This is now fully supported including the smooth attribute in Safari.