[SHOPTIME-3885] Keyword / 컨텐츠 없을 경우 포커싱 상이
[수정사항] NoSearchResults 랜더링되는 조건일때만 함수가 호출되도록 조건문 수정
This commit is contained in:
@@ -207,11 +207,21 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
}
|
||||
};
|
||||
|
||||
const handleBestSellerItemFocus = useCallback(() => {
|
||||
if (bestSellerDatas && bestSellerDatas.length > 0) {
|
||||
Spotlight.focus(`spotlightId-${bestSellerDatas[0].prdtId}`);
|
||||
}
|
||||
}, [bestSellerDatas]);
|
||||
const handleBestSellerItemFocus = useCallback(
|
||||
(e) => {
|
||||
if (
|
||||
searchPerformed &&
|
||||
searchQuery !== null &&
|
||||
bestSellerDatas &&
|
||||
bestSellerDatas.length > 0 &&
|
||||
e.key === "ArrowDown" &&
|
||||
Object.keys(searchDatas).length === 0
|
||||
) {
|
||||
Spotlight.focus(`spotlightId-${bestSellerDatas[0].prdtId}`);
|
||||
}
|
||||
},
|
||||
[bestSellerDatas, searchDatas, searchPerformed, searchQuery]
|
||||
);
|
||||
|
||||
const cursorPosition = () => {
|
||||
const input = document.querySelector(
|
||||
|
||||
Reference in New Issue
Block a user