fix(SW-441): fixes after PR
This commit is contained in:
@@ -46,12 +46,9 @@ export default function useScrollSpy(
|
||||
const observer = new IntersectionObserver(handleIntersection, mergedOptions)
|
||||
const elements = sectionIds
|
||||
.map((id) => document.getElementById(id))
|
||||
.filter(Boolean)
|
||||
.filter((el): el is HTMLElement => !!el)
|
||||
|
||||
elements.forEach((element) => {
|
||||
if (!element) {
|
||||
return
|
||||
}
|
||||
observer.observe(element)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user