-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I am trying to get a smooth scroll to an element with a sticky navigation bar.
Overriding behavior (to add an offset) also overrides the smooth scroll. Can someone give me some advice on how to make this work?
const scrollIntoViewSmoothly =
'scrollBehavior' in document.documentElement.style
? scrollIntoView
: smoothScrollIntoView
scrollIntoViewSmoothly(node, {
block: 'start',
behavior: (actions) =>
actions.forEach(({ el, top, left }, i) => {
el.scrollTop = i === 0 ? top - 90 : top
el.scrollLeft = left
}),
})
thedamon, kachkaev and n4bb12
Metadata
Metadata
Assignees
Labels
No labels