add props TButtonScroller (forcedFocus)
This commit is contained in:
@@ -27,6 +27,7 @@ export default function TButtonScroller({
|
||||
width,
|
||||
className,
|
||||
resetScrollPosition,
|
||||
forcedFocus = true,
|
||||
}) {
|
||||
const { getScrollTo, scrollTop } = useScrollTo();
|
||||
|
||||
@@ -86,13 +87,15 @@ export default function TButtonScroller({
|
||||
}, [boxHeight, contentHeight]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!forcedFocus) return;
|
||||
|
||||
if (checkScrollPosition === "top") {
|
||||
console.log("#checkSco", checkScrollPosition);
|
||||
Spotlight.focus("spotlightId_TbuttonScrollerDown");
|
||||
} else if (checkScrollPosition === "bottom") {
|
||||
Spotlight.focus("spotlightId_TbuttonScrollerUp");
|
||||
}
|
||||
}, [checkScrollPosition]);
|
||||
}, [checkScrollPosition, forcedFocus]);
|
||||
return (
|
||||
<Container
|
||||
spotlightId="spotlightId-scrllerCotainer"
|
||||
|
||||
Reference in New Issue
Block a user