-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
First of all, thanks for the fantastic hook. Works like a charm! 👍
So, I have a page with dynamically generated sections with editable content, so the last section on the page sometimes has a small height say 100px and doesn't trigger the hook like it should be for other sections on the page
The hook works perfectly, even for the last section on the page, if it's height is large enough to be covered into the threshold value calculated using the offsetPx prop
import useScrollSpy from 'react-use-scrollspy';
// if I have 3 sections, and the height of the 3rd(last) section is small
// then activeSection value is never set to its index value i.e. 2
const activeSection = useScrollSpy({
sectionElementRefs: sectionRefsArray,
offsetPx: Y_OFFSET
});Is there any way to handle this scenario?
Metadata
Metadata
Assignees
Labels
No labels