๐จ Palette: [UX improvement] Improve disabled button accessibility - #640
๐จ Palette: [UX improvement] Improve disabled button accessibility#640seonghobae wants to merge 1 commit into
Conversation
This changes the disabled button in the export modal from using the native `disabled` attribute to `aria-disabled=true` along with a `preventDefault` onClick handler. This maintains keyboard focus for screen reader users so they can hear the aria-describedby hint explaining why the button is disabled.
|
๐ Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a ๐ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR improves keyboard/screen-reader accessibility in the โ๊ณต์ ๋ฐ ๋ด๋ณด๋ด๊ธฐโ modal by making the โ์ ๊ทผ ๊ด๋ฆฌโ button focusable while still conveying a disabled state and its help text via ARIA.
Changes:
- Replaced native
disabledon the โ์ ๊ทผ ๊ด๋ฆฌโ button witharia-disabledand a click guard to keep it in the tab order. - Updated the corresponding Vitest assertion to validate
aria-disabledinstead oftoBeDisabled().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/components/modals/ExportModal.tsx | Makes the โ์ ๊ทผ ๊ด๋ฆฌโ button focusable while indicating disabled state via ARIA. |
| frontend/src/components/modals/ExportModal.test.tsx | Updates tests to align with the new ARIA-disabled behavior. |
๐ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type="button" | ||
| disabled | ||
| aria-disabled={true} | ||
| onClick={(e) => e.preventDefault()} |
| const accessManagementButton = screen.getByRole('button', { name: '์ ๊ทผ ๊ด๋ฆฌ' }); | ||
| expect(accessManagementButton).toBeDisabled(); | ||
| expect(accessManagementButton).toHaveAttribute('aria-disabled', 'true'); | ||
| expect(accessManagementButton).toHaveAttribute('aria-describedby', 'share-export-access-hint'); |
๐ก What:
'๊ณต์ ๋ฐ ๋ด๋ณด๋ด๊ธฐ' ๋ชจ๋ฌ์ '์ ๊ทผ ๊ด๋ฆฌ' ๋ฒํผ์์ ๋ค์ดํฐ๋ธ
disabled์์ฑ์ ์ ๊ฑฐํ๊ณaria-disabled={true}๋ฐonClick={(e) => e.preventDefault()}ํธ๋ค๋ฌ๋ก ๋์ฒดํ์ต๋๋ค. ์ด์ ํจ๊ป ๊ด๋ จ Vitest ํ ์คํธ๋ฅผ ์ ๋ฐ์ดํธํ์ต๋๋ค.๐ฏ Why:
๋ค์ดํฐ๋ธ
disabled์์ฑ์ด ์๋ ๋ฒํผ์ ํค๋ณด๋ ํญ(Tab) ํฌ์ปค์ค ์์์์ ์ ์ธ๋ฉ๋๋ค. ์ด ๋๋ฌธ์ ์คํฌ๋ฆฐ ๋ฆฌ๋ ๋ฐ ํค๋ณด๋ ์ ์ฉ ์ฌ์ฉ์๋ ํด๋น ๋ฒํผ์ ์ ๊ทผํ ์ ์์ด, ์ ๋ฒํผ์ด ๋นํ์ฑํ๋์๋์ง(aria-describedby๋ก ์ฐ๊ฒฐ๋ ์๋ด ๋ฌธ๊ตฌ)๋ฅผ ์ธ์งํ์ง ๋ชปํ๋ ์ ๊ทผ์ฑ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค.๐ธ Before/After:
<button disabled aria-describedby="...">์ ๊ทผ ๊ด๋ฆฌ</button>(ํค๋ณด๋ ํฌ์ปค์ค ๋ถ๊ฐ, ์คํฌ๋ฆฐ ๋ฆฌ๋ ์๋ด ๋ถ๊ฐ)<button aria-disabled={true} onClick={(e) => e.preventDefault()} aria-describedby="...">์ ๊ทผ ๊ด๋ฆฌ</button>(ํค๋ณด๋ ํฌ์ปค์ค ๊ฐ๋ฅ, ํด๋ฆญ ๋ฐฉ์ง, ์คํฌ๋ฆฐ ๋ฆฌ๋ ์๋ด ์ ์ ์๋)โฟ Accessibility:
์ด์ ์คํฌ๋ฆฐ ๋ฆฌ๋ ์ฌ์ฉ์๊ฐ ํญ ํค๋ฅผ ์ฌ์ฉํด '์ ๊ทผ ๊ด๋ฆฌ' ๋ฒํผ์ ๋๋ฌํ ์ ์์ผ๋ฉฐ, ์์๊ฐ ๋นํ์ฑํ ์ํ์์ ์์ฑ์ผ๋ก ์๋ด๋ฐ๊ณ ์ฐ๊ฒฐ๋ ๋์๋ง ํ ์คํธ("์ ๊ทผ ๊ถํ ๊ด๋ฆฌ๋ ํ๋ก์ ํธ ๊ถํ ์ค์ ์์ ์ฒ๋ฆฌํฉ๋๋ค.")๋ฅผ ํจ๊ป ๋ค์ ์ ์์ต๋๋ค. ์๊ฐ์ ์คํ์ผ๋ง์ ๊ธฐ์กด
.exportModal__disabledHintButtonํด๋์ค๋ฅผ ํตํด ๋์ผํ๊ฒ ์ ์ง๋ฉ๋๋ค.PR created automatically by Jules for task 15750217097380166131 started by @seonghobae