[shoptime-3994] 라이브 상품 클릭시에만 상품리스트로 포커스 가도록 수정

This commit is contained in:
jiwon93.son
2025-11-10 09:55:31 +09:00
parent e7f44c5115
commit 28ca594f8e

View File

@@ -853,7 +853,6 @@ const PlayerPanel = ({
const handleItemFocus = useCallback( const handleItemFocus = useCallback(
(menu) => { (menu) => {
dispatch(sendLogGNB(menu)); dispatch(sendLogGNB(menu));
console.log("###handleItemFocus", menu);
if (!videoVerticalVisible) { if (!videoVerticalVisible) {
resetTimer(REGULAR_TIMEOUT); resetTimer(REGULAR_TIMEOUT);
} }
@@ -864,7 +863,6 @@ const PlayerPanel = ({
const onClickBack = useCallback( const onClickBack = useCallback(
(ev, isEnd) => { (ev, isEnd) => {
//modal로부터 Full 전환된 경우 다시 preview 모드로 돌아감. //modal로부터 Full 전환된 경우 다시 preview 모드로 돌아감.
console.log("###onClickBack", backupInitialIndex, isEnd);
if ( if (
sideContentsVisible && sideContentsVisible &&
!videoVerticalVisible && !videoVerticalVisible &&
@@ -968,7 +966,7 @@ const PlayerPanel = ({
// 아이템클릭 진입시 포커스 // 아이템클릭 진입시 포커스
let hasProperSpot = false; let hasProperSpot = false;
let targetId; let targetId;
if (!isInitialFocusOccurred) { if (!isInitialFocusOccurred || panelInfo.targetId) {
targetId = panelInfo.targetId; targetId = panelInfo.targetId;
initialFocusTimeoutJob.current.start(() => { initialFocusTimeoutJob.current.start(() => {
@@ -990,6 +988,11 @@ const PlayerPanel = ({
if (retryTarget) { if (retryTarget) {
Spotlight.focus(retryTarget); Spotlight.focus(retryTarget);
setIsInitialFocusOccurred(true); setIsInitialFocusOccurred(true);
} else {
if (shopNowInfo?.length > 0) {
Spotlight.focus("playVideoShopNowBox");
setIsInitialFocusOccurred(true);
}
} }
}); });
} }
@@ -1000,6 +1003,7 @@ const PlayerPanel = ({
panelInfo.targetId, panelInfo.targetId,
panelInfo.modal, panelInfo.modal,
videoVerticalVisible, videoVerticalVisible,
shopNowInfo,
]); ]);
const videoInitialFocused = useCallback(() => { const videoInitialFocused = useCallback(() => {
@@ -1024,15 +1028,15 @@ const PlayerPanel = ({
} }
} }
if (!panelInfo.modal && !videoVerticalVisible && !hasProperSpot) {
Spotlight.focus(SpotlightIds.PLAYER_TAB_BUTTON);
return;
}
//비디오 진입시 포커스
if (panelInfo.isIndicatorByClick && shopNowInfo?.length > 0) { if (panelInfo.isIndicatorByClick && shopNowInfo?.length > 0) {
Spotlight.focus("playVideoShopNowBox"); Spotlight.focus("playVideoShopNowBox");
return; return;
} }
if (!panelInfo.modal && !videoVerticalVisible && !hasProperSpot) {
Spotlight.focus(SpotlightIds.PLAYER_TAB_BUTTON);
return;
}
}, [ }, [
shopNowInfo, shopNowInfo,
videoVerticalVisible, videoVerticalVisible,
@@ -1183,12 +1187,16 @@ const PlayerPanel = ({
videoInitialFocused(); videoInitialFocused();
} }
} }
}, [playListInfo]); }, [playListInfo, panelInfo.targetId]);
//10초 후 닫힐때 TabButton 포커스 //10초 후 닫힐때 TabButton 포커스
useEffect(() => { useEffect(() => {
if (playListInfo && playListInfo.length > 0) { if (playListInfo && playListInfo.length > 0) {
videoInitialFocused(); if (panelInfo.targetId) {
videoItemFocused();
} else {
videoInitialFocused();
}
} }
}, [sideContentsVisible, panelInfo.modal]); }, [sideContentsVisible, panelInfo.modal]);
@@ -1818,6 +1826,7 @@ const PlayerPanel = ({
}, },
}) })
); );
Spotlight.focus("playVideoShopNowBox");
} }
} }
if (!sideContentsVisible) { if (!sideContentsVisible) {
@@ -1830,6 +1839,7 @@ const PlayerPanel = ({
selectedIndex, selectedIndex,
sideContentsVisible, sideContentsVisible,
initialEnter, initialEnter,
panelInfo,
]); ]);
const handleIndicatorUpClick = useCallback(() => { const handleIndicatorUpClick = useCallback(() => {
@@ -1871,6 +1881,7 @@ const PlayerPanel = ({
}, },
}) })
); );
Spotlight.focus("playVideoShopNowBox");
} }
} }
if (!sideContentsVisible) { if (!sideContentsVisible) {
@@ -1883,6 +1894,7 @@ const PlayerPanel = ({
selectedIndex, selectedIndex,
sideContentsVisible, sideContentsVisible,
initialEnter, initialEnter,
panelInfo,
]); ]);
useEffect(() => { useEffect(() => {