|
|
|
|
@ -34,11 +34,13 @@ const SecondaryPageLayout = forwardRef(
@@ -34,11 +34,13 @@ const SecondaryPageLayout = forwardRef(
|
|
|
|
|
useImperativeHandle( |
|
|
|
|
ref, |
|
|
|
|
() => ({ |
|
|
|
|
scrollToTop: () => { |
|
|
|
|
if (scrollAreaRef.current) { |
|
|
|
|
return scrollAreaRef.current.scrollTo({ top: 0, behavior: 'smooth' }) |
|
|
|
|
} |
|
|
|
|
window.scrollTo({ top: 0, behavior: 'smooth' }) |
|
|
|
|
scrollToTop: (behavior: ScrollBehavior = 'smooth') => { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
if (scrollAreaRef.current) { |
|
|
|
|
return scrollAreaRef.current.scrollTo({ top: 0, behavior }) |
|
|
|
|
} |
|
|
|
|
window.scrollTo({ top: 0, behavior }) |
|
|
|
|
}, 10) |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
[] |
|
|
|
|
@ -46,7 +48,7 @@ const SecondaryPageLayout = forwardRef(
@@ -46,7 +48,7 @@ const SecondaryPageLayout = forwardRef(
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (isSmallScreen) { |
|
|
|
|
setTimeout(() => window.scrollTo({ top: 0 }), 0) |
|
|
|
|
setTimeout(() => window.scrollTo({ top: 0 }), 10) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}, []) |
|
|
|
|
|