[SHOPTIME-3438] On Sale / 로딩 중 우방향키를 계속 누르면 GNB가 열림
변경 파일: 1. TabLayout.jsx 변경 내용: 1. `handleNavigation` 함수 수정 (조건에 따른 로직 수정)
This commit is contained in:
@@ -439,11 +439,12 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
||||
[]
|
||||
);
|
||||
|
||||
const onFocus = () => {
|
||||
const onFocus = useCallback(() => {
|
||||
if (showSubTab) {
|
||||
setSecondDepthReduce((prev) => !prev);
|
||||
}
|
||||
};
|
||||
}, [showSubTab]);
|
||||
|
||||
const spotToPanel = useCallback(() => {
|
||||
const node = document.querySelector(`[id="${SpotlightIds.TPANEL}"]`);
|
||||
if (node) {
|
||||
@@ -456,6 +457,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
||||
setMainSelectedIndex(index);
|
||||
mouseMainEntered.current = false;
|
||||
mouseNavOpen.current.stop();
|
||||
|
||||
//같은패널로 클릭이벤트가 호출될때
|
||||
if (
|
||||
Array.isArray(target) &&
|
||||
@@ -464,14 +466,13 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
||||
panels[0]?.name === target[0]?.name
|
||||
) {
|
||||
deActivateTab();
|
||||
setMainExpanded(false);
|
||||
spotToPanel();
|
||||
return;
|
||||
}
|
||||
|
||||
// 홈패널일 경우
|
||||
if (target && target[0]?.name === panel_names.HOME_PANEL) {
|
||||
deActivateTab();
|
||||
// setSelectedSubItemId(null);
|
||||
spotToPanel();
|
||||
dispatch(resetPanels());
|
||||
dispatch(checkEnterThroughGNB(true));
|
||||
@@ -487,16 +488,16 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
//그 외 나머지
|
||||
if (target) {
|
||||
dispatch(resetPanels(target));
|
||||
deActivateTab();
|
||||
dispatch(resetPanels(target));
|
||||
panelSwitching.current = true;
|
||||
panelSwitchingJob.start(panelSwitching);
|
||||
spotToPanel();
|
||||
} else if (cursorVisibleRef.current) {
|
||||
setMainExpanded(true);
|
||||
}
|
||||
|
||||
dispatch(
|
||||
updateSpotlightId({
|
||||
name: panel_names.HOME_PANEL,
|
||||
|
||||
Reference in New Issue
Block a user