Repository navigation
v4.0.2
Bug fixes to scroll‑related hooks
-
useBodyScrollLockno longer blanks the page while the lock is held.
The previous implementation setoverflow: hiddenon the body and applied
position: fixed; top: -<scrollY>px, which clipped all content above the viewport.
The updated logic keepsoverflow: hiddenonly on the root element to suppress the scrollbar, leaving the page visible while the lock remains active. -
useScrollToElementsnow scrolls the target’s nearest scrollable ancestor whenoffsetis set, instead of always scrolling the window.
The lookup matchesscrollIntoView’s behavior: the closest ancestor withoverflow-yofauto,scroll, oroverlaythat actually overflows, withwindowas a fallback.
Thecontaineroption still takes precedence and is required only when the appropriate scroller isn’t an ancestor.
What's Changed
- 🐛 fix: align Close button in useBodyScrollLock demo modal by @pjb0811 in #169
- 🐛 fix: fix broken line layout in useIntersectionObserver demo output by @pjb0811 in #170
- 🔧 chore: remove spurious changeset for demo-only fixes by @pjb0811 in #172
- fix(ci): make changeset-draft dedup diff-based, exclude demo app from scope by @pjb0811 in #173
- ✨ feat: add Docusaurus documentation site by @pjb0811 in #174
- 🐛 fix: correct canonical domain to use-hooks-lab.vercel.app by @pjb0811 in #175
- 🐛 fix: correct SSR hydration mismatch in useEventListener demo by @pjb0811 in #180
- 📝 docs: show canonical hook names instead of deprecated aliases by @pjb0811 in #181
- 📝 docs: add a heading + anchor for every hook, restoring findability by @pjb0811 in #182
- 🧹 chore: remove Docusaurus migration leftovers by @pjb0811 in #183
- 🔧 chore: bump @jbpark/ui-kit to 5.4.4 by @pjb0811 in #184
- 🎨 chore: switch docs theme palette to black-and-white, matching ui-kit by @pjb0811 in #185
- 🎨 chore: recolor favicon to black-and-white, matching site theme by @pjb0811 in #186
- ✨ feat: replace default Docusaurus homepage with a ui-kit-styled one by @pjb0811 in #187
- 🐛 fix: extract nvidia-chat.mjs with model fallback and think-block strip by @pjb0811 in #188
- 🔧 chore: modernize CI action versions and drop pnpm version pin by @pjb0811 in #189
- 🐛 fix: log nvidia-chat diagnostics to stderr, not stdout by @pjb0811 in #190
- docs: drop gitmoji from PR template checklist by @pjb0811 in #191
- chore: drop emoji labels from PR template type-of-change by @pjb0811 in #192
- feat(docs): render demo snippets in ui-kit's read-only CodeEditor by @pjb0811 in #193
- fix(docs): restore the vertical rhythm between hook demos by @pjb0811 in #194
- fix(docs): dedupe @jbpark/ui-kit so CodeEditor sees the Config context by @pjb0811 in #195
- refactor(docs): move the demos into the website so ui-kit resolves once by @pjb0811 in #197
- chore(web): pin the docs site to the same pnpm version as the library by @pjb0811 in #198
- fix(hooks): scroll the nearest scrollable ancestor when useScrollToElements has an offset by @pjb0811 in #199
- fix(hooks): stop useBodyScrollLock from clipping the page while locked by @pjb0811 in #201
- 🔖 chore: version packages by @github-actions[bot] in #200
Full Changelog: v4.0.1...v4.0.2