[SHOPTIME-3886] Trending Now / Best Seller 상품 확인 후 최하단 Top 버튼 클릭시 포커싱 사라짐

[원인] 1. topInfo 데이터가 없을때는 빈배열로 내려오기 때문에 !topInfo === false로 평가되기 때문에
         조건문을 통과할 수 없음

      2. Top 버튼을 눌렀을 때 Top으로 이동하지 않고 버튼 바로 위 아이템으로 포커스가 가능현상 수정
        (맨위 첫번째아이템으로 SpotlightId 할당)

[대책] length로 분기처리함
This commit is contained in:
고동영
2024-12-10 15:15:46 +09:00
parent a303d124dd
commit 65fe96da84

View File

@@ -218,10 +218,9 @@ const TrendingNowPanel = ({ panelInfo, spotlightId, isOnTop, ...rest }) => {
let target = SpotlightIds.TRENDING_NOW_POPULAR_VIDEO;
if (!topInfos && bestSeller && bestSeller.length > 0) {
target = SpotlightIds.TRENDING_NOW_BEST_SELLER;
if (topInfos.length === 0 && bestSeller && bestSeller.length > 0) {
target = `spotlightId-bestSeller-${bestSeller[0]?.prdtId}`;
}
Spotlight.focus(target);
setContainerLastFocusedElement(null, [
SpotlightIds.TRENDING_NOW_BEST_SELLER,