homepanel focus

This commit is contained in:
yonghyon
2024-07-30 20:40:38 +09:00
parent ab6d639178
commit fb6b7c5337
2 changed files with 17 additions and 6 deletions

View File

@@ -28,7 +28,10 @@ import {
import { sendLogGNB } from "../../actions/logActions";
import { getSubCategory, getTop20Show } from "../../actions/mainActions";
import { getHomeOnSaleInfo } from "../../actions/onSaleActions";
import { finishVideoPreview } from "../../actions/playActions";
import {
finishVideoPreview,
startVideoPlayer,
} from "../../actions/playActions";
import { getBestSeller } from "../../actions/productActions";
import TBody from "../../components/TBody/TBody";
import TButton, { TYPES } from "../../components/TButton/TButton";
@@ -352,6 +355,9 @@ export default function HomePanel({ isOnTop }) {
setTimeout(() => {
Spotlight.resume();
setFirstSpot(true);
if (Spotlight.getPointerMode()) {
dispatch(finishVideoPreview());
}
if (panelInfo.currentCatCd) {
Spotlight.focus("spotlightId-" + panelInfo.currentCatCd);
}

View File

@@ -259,6 +259,10 @@ const PlayerPanel = ({
(state) => state.common.broadcast
);
const lastPanelAction = USE_SELECTOR(
"lastPanelAction",
(state) => state.panels.lastPanelAction
);
const nowMenu = USE_SELECTOR("nowMenu", (state) => state.common.menu.nowMenu);
const nowMenuRef = usePrevious(nowMenu);
const entryMenu = USE_SELECTOR(
@@ -749,11 +753,8 @@ const PlayerPanel = ({
modalClassName: "",
})
);
videoPlayer.current?.hideControls();
setSelectedIndex(backupInitialIndex);
dispatch(changeAppStatus({ cursorVisible: false }));
Spotlight.setPointerMode(false);
if (panelInfo.shptmBanrTpNm === "MEDIA") {
dispatch(
updatePanel({
@@ -772,7 +773,6 @@ const PlayerPanel = ({
if (!panelInfo.modal) {
dispatch(PanelActions.popPanel());
dispatch(changeAppStatus({ cursorVisible: false }));
Spotlight.setPointerMode(false);
// ev?.stopPropagation();
ev?.preventDefault();
return;
@@ -1248,7 +1248,12 @@ const PlayerPanel = ({
);
useEffect(() => {
if (panelInfo.modal && panelInfo.modalContainerId) {
if (
panelInfo.modal &&
panelInfo.modalContainerId &&
lastPanelAction === "previewPush"
) {
const node = document.querySelector(
`[data-spotlight-id="${panelInfo.modalContainerId}"]`
);