focus error
This commit is contained in:
@@ -77,17 +77,19 @@ export default function TPopUp({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const c = Spotlight.getCurrent();
|
const c = Spotlight.getCurrent();
|
||||||
let timer;
|
let timer;
|
||||||
if (c) {
|
if(open){
|
||||||
Spotlight.focus("tPopupBtn1");
|
if (c) {
|
||||||
Spotlight.focus("tPopupBtn2");
|
Spotlight.focus("tPopupBtn1");
|
||||||
} else {
|
Spotlight.focus("tPopupBtn2");
|
||||||
if (kind === "exitPopup") {
|
} else {
|
||||||
timer = setTimeout(() => {
|
if (kind === "exitPopup") {
|
||||||
Spotlight.focus("tPopupBtn2");
|
timer = setTimeout(() => {
|
||||||
}, 0);
|
Spotlight.focus("tPopupBtn2");
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (options) Spotlight.focus("selectedOptionBtn");
|
||||||
}
|
}
|
||||||
if (options) Spotlight.focus("selectedOptionBtn");
|
|
||||||
return () => {
|
return () => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
|
|
||||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
|
||||||
|
|
||||||
import ItemContents from "./ItemContents/ItemContents";
|
|
||||||
import ShowContents from "./ShowContents/ShowContents";
|
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
|
||||||
{ leaveFor: { left: "", right: "" }, enterTo: "last-focused" },
|
|
||||||
"div"
|
|
||||||
);
|
|
||||||
|
|
||||||
export default function CategoryContents({ activeTab }) {
|
|
||||||
const datas = useSelector((state) => state.main.subCategoryData);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container>
|
|
||||||
{activeTab === "SHOW" ? <ShowContents /> : <ItemContents />}
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,7 @@ import NoResultsCategoryShows from "../NoResultsCategory/NoResultsCategoryShows"
|
|||||||
import css from "./ShowContents.module.less";
|
import css from "./ShowContents.module.less";
|
||||||
import ShowLists from "./ShowLists/ShowLists";
|
import ShowLists from "./ShowLists/ShowLists";
|
||||||
import ShowProductContents from "./ShowProductContents/ShowProductContents";
|
import ShowProductContents from "./ShowProductContents/ShowProductContents";
|
||||||
|
import { startVideoPlayer } from "../../../../actions/playActions";
|
||||||
|
|
||||||
const SpottableVideoContainer = Spottable("div");
|
const SpottableVideoContainer = Spottable("div");
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
@@ -30,14 +31,12 @@ export default function ShowContents({onClick}) {
|
|||||||
const _handleItemClick = useCallback((patnrId, showId, lgCatCd, showUrl)=>(ev) => {
|
const _handleItemClick = useCallback((patnrId, showId, lgCatCd, showUrl)=>(ev) => {
|
||||||
onClick && onClick(ev);
|
onClick && onClick(ev);
|
||||||
dispatch(
|
dispatch(
|
||||||
pushPanel({
|
startVideoPlayer({
|
||||||
name: panel_names.PLAYER_PANEL,
|
showId,
|
||||||
panelInfo: {
|
patnrId,
|
||||||
showId: showId,
|
shptmBanrTpNm: "VOD",
|
||||||
patnrId: patnrId,
|
lgCatCd,
|
||||||
shptmBanrTpNm: "VOD",
|
modal: false,
|
||||||
lgCatCd: lgCatCd,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
},[onClick]);
|
},[onClick]);
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ const BestSeller = ({ order, scrollTopBody, panelInfo }) => {
|
|||||||
onBlur={() => handleBlur(itemIndex)}
|
onBlur={() => handleBlur(itemIndex)}
|
||||||
onClick={() => handleCardClick(patnrId, prdtId)}
|
onClick={() => handleCardClick(patnrId, prdtId)}
|
||||||
offerInfo={offerInfo}
|
offerInfo={offerInfo}
|
||||||
|
spotlightId={'bestsellerItem'+itemIndex}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
const [firstLgCatCd, setFirstLgCatCd] = useState(
|
const [firstLgCatCd, setFirstLgCatCd] = useState(
|
||||||
homeSpotlight?.currentCatCd ? homeSpotlight.currentCatCd : "1017"
|
homeSpotlight?.currentCatCd ? homeSpotlight.currentCatCd : "1017"
|
||||||
);
|
);
|
||||||
|
const spotYoffsetRef = useRef(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (httpHeader) {
|
if (httpHeader) {
|
||||||
dispatch(getHomeLayout());
|
dispatch(getHomeLayout());
|
||||||
@@ -81,8 +82,7 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
tabType: "CAT00102",
|
tabType: "CAT00102",
|
||||||
filterType: "CAT00202",
|
filterType: "CAT00202",
|
||||||
},
|
},
|
||||||
1,
|
1
|
||||||
false
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
dispatch(getTop20Show());
|
dispatch(getTop20Show());
|
||||||
@@ -94,7 +94,6 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
homeSaleInfosIncFlag: "Y",
|
homeSaleInfosIncFlag: "Y",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
dispatch(updateSpotlightId());
|
|
||||||
}
|
}
|
||||||
}, [dispatch, httpHeader]);
|
}, [dispatch, httpHeader]);
|
||||||
|
|
||||||
@@ -109,15 +108,14 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
const [homeLayoutInfoDetail, setHomeLayoutInfoDetail] = useState([]);
|
const [homeLayoutInfoDetail, setHomeLayoutInfoDetail] = useState([]);
|
||||||
const [btnActive, setBtnActive] = useState(true);
|
const [btnActive, setBtnActive] = useState(true);
|
||||||
const [arrowBottom, setArrowBottom] = useState(true);
|
const [arrowBottom, setArrowBottom] = useState(true);
|
||||||
let spotYoffset = null;
|
|
||||||
|
|
||||||
const _onScrollStop = (e) => {
|
const _onScrollStop = (e) => {
|
||||||
spotYoffset = e.scrollTop;
|
spotYoffsetRef.current = e.scrollTop;
|
||||||
};
|
};
|
||||||
|
|
||||||
const arrowRef = useRef();
|
const arrowRef = useRef();
|
||||||
|
|
||||||
const _onScroll = () => {
|
const _onScroll = (ev) => {
|
||||||
const element = arrowRef.current;
|
const element = arrowRef.current;
|
||||||
const rect = element.getBoundingClientRect();
|
const rect = element.getBoundingClientRect();
|
||||||
|
|
||||||
@@ -129,25 +127,27 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (homeSpotlight) {
|
|
||||||
const { y } = homeSpotlight;
|
|
||||||
scrollTopBody({ y, animate: false });
|
|
||||||
setFirstSpot(true);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
if (homeSpotlight) {
|
||||||
Spotlight.resume();
|
const { y } = homeSpotlight;
|
||||||
Spotlight.focus(homeSpotlight.currentSpot);
|
scrollTopBody({ y, animate: false });
|
||||||
|
setTimeout(() => {
|
||||||
|
Spotlight.resume();
|
||||||
|
scrollTopBody({ y, animate: false }); //call again after some seconds
|
||||||
|
if(homeSpotlight.currentSpot){
|
||||||
|
Spotlight.focus(homeSpotlight.currentSpot);
|
||||||
|
}
|
||||||
|
setBtnActive(false);
|
||||||
|
setFirstSpot(true);
|
||||||
|
}, 300);
|
||||||
|
} else {
|
||||||
setBtnActive(false);
|
setBtnActive(false);
|
||||||
}, 300);
|
}
|
||||||
} else {
|
|
||||||
setBtnActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const c = Spotlight.getCurrent();
|
const c = Spotlight.getCurrent();
|
||||||
let targetSpotlightId = null;
|
let targetSpotlightId = null;
|
||||||
let targetSpotlightCatcd = null;
|
let targetSpotlightCatcd = null;
|
||||||
let absoluteY = spotYoffset;
|
|
||||||
if (c) {
|
if (c) {
|
||||||
targetSpotlightId = c.getAttribute("data-spotlight-id");
|
targetSpotlightId = c.getAttribute("data-spotlight-id");
|
||||||
targetSpotlightCatcd = c.getAttribute("data-catcd-num");
|
targetSpotlightCatcd = c.getAttribute("data-catcd-num");
|
||||||
@@ -158,12 +158,19 @@ export default function HomePanel({ isOnTop }) {
|
|||||||
panelInfo: {
|
panelInfo: {
|
||||||
currentSpot: targetSpotlightId,
|
currentSpot: targetSpotlightId,
|
||||||
currentCatCd: targetSpotlightCatcd,
|
currentCatCd: targetSpotlightCatcd,
|
||||||
y: absoluteY,
|
y: spotYoffsetRef.current,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(firstSpot){
|
||||||
|
dispatch(updateSpotlightId());
|
||||||
|
}
|
||||||
|
}, [firstSpot]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (homeTopDisplayInfos) {
|
if (homeTopDisplayInfos) {
|
||||||
setSelectTemplate(homeTopDisplayInfos[0].shptmTmplCd);
|
setSelectTemplate(homeTopDisplayInfos[0].shptmTmplCd);
|
||||||
|
|||||||
Reference in New Issue
Block a user