[TrendingNowPanel] BestSeller 인덱스 0번째 상품 포커스 오류 해결

This commit is contained in:
jiwon93.son
2024-04-02 17:32:07 +09:00
parent 3af5a90690
commit 95caa68cac

View File

@@ -9,9 +9,7 @@ import { pushPanel, updatePanel } from "../../actions/panelActions";
import SectionTitle from "../../components/SectionTitle/SectionTitle"; import SectionTitle from "../../components/SectionTitle/SectionTitle";
import TBody from "../../components/TBody/TBody"; import TBody from "../../components/TBody/TBody";
import TButton, { TYPES } from "../../components/TButton/TButton"; import TButton, { TYPES } from "../../components/TButton/TButton";
import TItemCard, { import TItemCard from "../../components/TItemCard/TItemCard";
removeDotAndColon,
} from "../../components/TItemCard/TItemCard";
import TPanel from "../../components/TPanel/TPanel"; import TPanel from "../../components/TPanel/TPanel";
import useScrollReset from "../../hooks/useScrollReset"; import useScrollReset from "../../hooks/useScrollReset";
import useScrollTo from "../../hooks/useScrollTo"; import useScrollTo from "../../hooks/useScrollTo";
@@ -69,9 +67,11 @@ export default function TrendingNowPanel({ panelInfo }) {
Spotlight.focus(targetId); Spotlight.focus(targetId);
}, 0); }, 0);
}, [targetId]); }, [targetId]);
const handleTopButtonClick = useCallback(() => { const handleTopButtonClick = useCallback(() => {
scrollTop(); scrollTop();
}, []); }, []);
useEffect(() => { useEffect(() => {
if (panelInfo.currentSpot) { if (panelInfo.currentSpot) {
Spotlight.focus(panelInfo.currentSpot); Spotlight.focus(panelInfo.currentSpot);
@@ -92,6 +92,7 @@ export default function TrendingNowPanel({ panelInfo }) {
); );
}; };
}, []); }, []);
useEffect(() => { useEffect(() => {
if (!firstChk && !panelInfo.currentSpot) { if (!firstChk && !panelInfo.currentSpot) {
Spotlight.focus("popular_video"); Spotlight.focus("popular_video");
@@ -118,7 +119,6 @@ export default function TrendingNowPanel({ panelInfo }) {
productName={item.prdtNm} productName={item.prdtNm}
isBestSeller={true} isBestSeller={true}
rank={item.rankOrd} rank={item.rankOrd}
onFocus={index === 0 ? handleScrollReset : null}
onBlur={handleStopScrolling} onBlur={handleStopScrolling}
onClick={() => handleCardClick(item)} onClick={() => handleCardClick(item)}
offerInfo={item.offerInfo} offerInfo={item.offerInfo}