[251114] fix: ProductAllSection Focus복구 로직-1
🕐 커밋 시간: 2025. 11. 14. 16:57:47 📊 변경 통계: • 총 파일: 1개 • 추가: +18줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx
This commit is contained in:
@@ -713,6 +713,24 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []); // 마운트/언마운트 시에만 실행
|
||||
|
||||
// MediaPanel modal 상태 변화 감지 -> ProductVideo로 포커스 이동
|
||||
useEffect(() => {
|
||||
const topPanel = panels[panels.length - 1];
|
||||
|
||||
// MediaPanel이 modal=true로 복귀했을 때 포커스를 ProductVideo로 이동
|
||||
if (
|
||||
topPanel &&
|
||||
topPanel.name === panel_names.MEDIA_PANEL &&
|
||||
topPanel.panelInfo.modal === true
|
||||
) {
|
||||
console.log('[DetailPanel] MediaPanel modal=true detected - focusing ProductVideo');
|
||||
const focusTimer = setTimeout(() => {
|
||||
Spotlight.focus('product-video-player');
|
||||
}, 500);
|
||||
return () => clearTimeout(focusTimer);
|
||||
}
|
||||
}, [panels]);
|
||||
|
||||
return (
|
||||
<div ref={containerRef}>
|
||||
<DetailPanelBackground launchedFromPlayer={panelLaunchedFromPlayer} />
|
||||
|
||||
Reference in New Issue
Block a user