From b336a0547e8106a5a30e5b64f34c6922595f1617 Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Fri, 15 May 2026 14:41:11 -0400 Subject: [PATCH] fix(documentation-framework): handle null errors in useIsStuck --- packages/documentation-framework/hooks/useIsStuck.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/documentation-framework/hooks/useIsStuck.js b/packages/documentation-framework/hooks/useIsStuck.js index 2f19bc364f..ce50706b73 100644 --- a/packages/documentation-framework/hooks/useIsStuck.js +++ b/packages/documentation-framework/hooks/useIsStuck.js @@ -7,6 +7,11 @@ export const useIsStuck = (stickyElementId) => { const scrollElement = document.getElementById('ws-page-main'); const stickyElement = document.getElementById(stickyElementId); + if (!scrollElement || !stickyElement) { + setIsStuck(false); + return; + } + const syncFromScroll = () => { setIsStuck(scrollElement.scrollTop > stickyElement.getBoundingClientRect().top); };