[251121] fix: ProductAllSection에서 FavoriteBtn 엔터 이벤트
🕐 커밋 시간: 2025. 11. 21. 10:57:07 📊 변경 통계: • 총 파일: 1개 • 추가: +11줄 • 삭제: -2줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/DetailPanel/components/FavoriteBtn.jsx 🔧 주요 변경 내용: • UI 컴포넌트 아키텍처 개선
This commit is contained in:
@@ -66,18 +66,27 @@ export default function FavoriteBtn({
|
||||
onFavoriteFlagChanged(favoriteFlag === 'Y' ? 'N' : 'Y');
|
||||
}, [dispatch, favoriteFlag, onFavoriteFlagChanged]);
|
||||
|
||||
const handleFavoriteKeyDown = useCallback((e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
handleFavoriteClick();
|
||||
}
|
||||
}, [handleFavoriteClick]);
|
||||
|
||||
return (
|
||||
<SpottableDiv
|
||||
className={classNames(css.favorBtnContainer, kind === 'item_detail' ? css.smallSize : '')}
|
||||
spotlightId="favoriteBtn"
|
||||
onClick={handleFavoriteClick}
|
||||
onKeyDown={handleFavoriteKeyDown}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
>
|
||||
<div
|
||||
className={classNames(
|
||||
css.favoriteButton,
|
||||
favoriteFlag === 'N' ? css.favorBtn : css.favorUnableBtn
|
||||
)}
|
||||
onClick={handleFavoriteClick}
|
||||
role="button"
|
||||
aria-label="Register in Favorites"
|
||||
/>
|
||||
{activePopup === Config.ACTIVE_POPUP.favoritePopup && (
|
||||
|
||||
Reference in New Issue
Block a user