ShopTime-4011 수정 및 onSaleNav 포커싱및 스크롤이동안되는 문제 추가수수정
This commit is contained in:
@@ -7,6 +7,7 @@ import TScroller from "../../../components/TScroller/TScroller";
|
||||
import useScrollTo from "../../../hooks/useScrollTo";
|
||||
import css from "./OnSaleNav.module.less";
|
||||
import OnSaleNavItem from "./OnSaleNavItem/OnSaleNavItem";
|
||||
import Spotlight from "@enact/spotlight";
|
||||
|
||||
const Container = SpotlightContainerDecorator(
|
||||
{ leaveFor: { right: "" }, enterTo: "last-focused" },
|
||||
@@ -59,22 +60,27 @@ export default function OnSaleNav({
|
||||
|
||||
const x = offsetFromContainerLeft - containerWidth + clippedWidth;
|
||||
|
||||
scrollLeft({ x });
|
||||
setTimeout(() => {
|
||||
scrollLeft({ x });
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}, [panelInfoLgCatCd, scrollLeft]);
|
||||
|
||||
useEffect(() => {
|
||||
if (panelInfoLgCatCd && previousPanelIsDetail) {
|
||||
const node = document //
|
||||
.querySelector(`[data-spotlight-id=spotlightId-${panelInfoLgCatCd}]`);
|
||||
|
||||
if (panelInfoLgCatCd) {
|
||||
const node = document.querySelector(
|
||||
`[data-spotlight-id=spotlightId-${panelInfoLgCatCd}]`
|
||||
);
|
||||
if (node) {
|
||||
const containerId = "on-sale-nav";
|
||||
setContainerLastFocusedElement(node, [containerId]);
|
||||
}
|
||||
setTimeout(() => {
|
||||
Spotlight.focus(node);
|
||||
}, 100);
|
||||
}
|
||||
}, [panelInfoLgCatCd, previousPanelIsDetail]);
|
||||
}, [panelInfoLgCatCd]);
|
||||
|
||||
return (
|
||||
<Container
|
||||
|
||||
@@ -107,13 +107,9 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
|
||||
if (categoryInfos) {
|
||||
dispatch(copyCategoryInfos(categoryInfos));
|
||||
setCategories(categoryInfos);
|
||||
if (!selectedLgCatCd && !selectedLgCatNm) {
|
||||
setSelectedLgCatCd(categoryInfos[0].lgCatCd);
|
||||
setSelectedLgCatNm(categoryInfos[0].lgCatNm);
|
||||
}
|
||||
setSelectedLgCatCd(panelInfo?.lgCatCd);
|
||||
setSelectedLgCatNm(panelInfo?.lgCatNm);
|
||||
}
|
||||
setSelectedLgCatCd(panelInfo?.lgCatCd);
|
||||
setSelectedLgCatNm(panelInfo?.lgCatNm);
|
||||
}
|
||||
}, [
|
||||
categories,
|
||||
|
||||
Reference in New Issue
Block a user