diff --git a/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.jsx b/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.jsx index 25bd410f..f017a593 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.jsx @@ -4,12 +4,23 @@ import classNames from 'classnames'; import { useSelector } from 'react-redux'; import { off, on } from '@enact/core/dispatcher'; +import { is } from '@enact/core/keymap'; import { Job } from '@enact/core/util'; import Scroller from '@enact/sandstone/Scroller'; +import Spotlight from '@enact/spotlight'; +import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator'; import AutoScrollAreaDetail, { POSITION } from '../AutoScrollAreaDetail/AutoScrollAreaDetail'; import css from './TScrollerDetail.module.less'; +const ScrollerContainer = SpotlightContainerDecorator( + { + enterTo: 'default-element', + restrict: 'self-only', + }, + 'div' +); + /** * DetailPanel 전용 TScroller - 커스텀 스크롤바 구현 * onScroll* event can't use Callback dependency @@ -183,8 +194,31 @@ const TScrollerDetail = forwardRef( } }, [direction]); + // 스크롤바에 포커스가 있을 때 arrow up/down을 처리하여 포커스 유지 + const handleScrollerKeyDown = useCallback( + (e) => { + const isUp = is('up')(e); + const isDown = is('down')(e); + + // arrow up/down일 때만 처리 + if ((isUp || isDown) && direction === 'vertical') { + // 현재 포커스된 요소가 스크롤바인지 확인 + const current = Spotlight.getCurrent(); + if (current && current.getAttribute('aria-label')?.includes('scroll')) { + // 스크롤바에 포커스가 있으면 기본 동작 방지하고 포커스 유지 + e.preventDefault(); + e.stopPropagation(); + } + } + }, + [direction] + ); + return ( -
+ @@ -224,7 +259,7 @@ const TScrollerDetail = forwardRef( cursorVisible={cursorVisible} /> ))} -
+ ); } ); diff --git a/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.module.less b/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.module.less index 1db73e82..daf9452c 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.module.less +++ b/com.twin.app.shoptime/src/views/DetailPanel/components/TScroller/TScrollerDetail.module.less @@ -80,6 +80,15 @@ } } } + + // 스크롤바 thumb의 포커스 상태 + > div:nth-child(1) { + > div { + &:focus { + background-color: @PRIMARY_COLOR_RED !important; + } + } + } } &.preventScroll {