Skip to content

Commit

Permalink
#1 improve: a11y - CdMenu role 부여 및 aria-expanded 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
boostksm committed Jul 9, 2023
1 parent 79164a1 commit abcae82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/AlbumControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ const AlbumControls = ({
onClick={showCdMenu}
$isHide={isCdMenuShow}
aria-label="show cd menu"
aria-expanded="false"
aria-controls="cdMenu"
>
<RiArrowUpDoubleLine className="icon" />
</Button>
<Button
onClick={hideCdMenu}
$isHide={!isCdMenuShow}
aria-label="hide cd menu"
aria-expanded="true"
aria-controls="cdMenu"
>
<RiArrowDownDoubleLine className="icon" />
</Button>
Expand Down
5 changes: 5 additions & 0 deletions src/components/CdMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const CdMenu = ({ albumData, isScrolling, selectSong }) => {
onMouseOver={showAlbumControls}
onMouseOut={hideAlbumControls}
$isCdMenuShow={isCdMenuShow}
aria-label="expandable menu"
role="region"
id="cdMenu"
>
<RotatingCd isFaster={isScrolling} albumArtUrl={albumData.albumArtUrl} />
<AlbumControls
Expand All @@ -62,6 +65,8 @@ const CdMenu = ({ albumData, isScrolling, selectSong }) => {
className="showMenuButton"
aria-label="show cd menu"
onClick={() => setIsCdMenuShow(true)}
aria-expanded="false"
aria-controls="cdMenu"
></button>
</CdMenuLayout>
);
Expand Down

0 comments on commit abcae82

Please sign in to comment.