Nebula icon indicating copy to clipboard operation
Nebula copied to clipboard

Update Nebula scrollTo function to include native scrollIntoView (🟩 fully supported now)

Open chrisblakley opened this issue 6 years ago • 4 comments

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

chrisblakley avatar Sep 10 '17 14:09 chrisblakley

Actually getting pretty close to full support: https://caniuse.com/#feat=scrollintoview

chrisblakley avatar May 03 '18 02:05 chrisblakley

el.scrollIntoView({
    behavior: 'smooth'
})

Note: Safari does not support the smooth behavior.

chrisblakley avatar May 14 '20 00:05 chrisblakley

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.

chrisblakley avatar Oct 25 '20 02:10 chrisblakley

This is now fully supported including the smooth attribute in Safari.

Screen Shot 2023-07-24 at 5 36 14 PM

chrisblakley avatar Jul 24 '23 21:07 chrisblakley