[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:
2025-11-21 10:57:08 +09:00
parent 62031c02a5
commit 8ee426de52

View File

@@ -66,18 +66,27 @@ export default function FavoriteBtn({
onFavoriteFlagChanged(favoriteFlag === 'Y' ? 'N' : 'Y'); onFavoriteFlagChanged(favoriteFlag === 'Y' ? 'N' : 'Y');
}, [dispatch, favoriteFlag, onFavoriteFlagChanged]); }, [dispatch, favoriteFlag, onFavoriteFlagChanged]);
const handleFavoriteKeyDown = useCallback((e) => {
if (e.key === 'Enter') {
e.preventDefault();
handleFavoriteClick();
}
}, [handleFavoriteClick]);
return ( return (
<SpottableDiv <SpottableDiv
className={classNames(css.favorBtnContainer, kind === 'item_detail' ? css.smallSize : '')} className={classNames(css.favorBtnContainer, kind === 'item_detail' ? css.smallSize : '')}
spotlightId="favoriteBtn" spotlightId="favoriteBtn"
onClick={handleFavoriteClick}
onKeyDown={handleFavoriteKeyDown}
role="button"
tabIndex={0}
> >
<div <div
className={classNames( className={classNames(
css.favoriteButton, css.favoriteButton,
favoriteFlag === 'N' ? css.favorBtn : css.favorUnableBtn favoriteFlag === 'N' ? css.favorBtn : css.favorUnableBtn
)} )}
onClick={handleFavoriteClick}
role="button"
aria-label="Register in Favorites" aria-label="Register in Favorites"
/> />
{activePopup === Config.ACTIVE_POPUP.favoritePopup && ( {activePopup === Config.ACTIVE_POPUP.favoritePopup && (