diff --git a/.jules/palette.md b/.jules/palette.md index bd0f73248..44054ea60 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -57,3 +57,6 @@ ## 2026-07-30 - Add window.confirm for destructive actions **Learning:** Destructive actions like deleting groups and edge relationships previously occurred immediately without user confirmation. **Action:** Always wrap delete operations with window.confirm() dialogs and ensure corresponding tests successfully mock window.confirm. +## 2023-10-27 - Disabled Button Accessibility with Tooltips +**Learning:** Native `disabled` attributes on buttons prevent them from receiving keyboard focus. If a disabled button relies on a tooltip or `aria-describedby` hint (e.g., explaining *why* it is disabled, like missing permissions), screen reader users navigating by keyboard will never discover the hint because the button is skipped in the tab order. +**Action:** When a disabled button has an explanatory hint, do not use the native `disabled` attribute. Instead, use `aria-disabled="true"`, apply disabled visual styles using CSS attribute selectors (e.g., `button[aria-disabled="true"]`), and manually prevent the action in the `onClick` handler (`e.preventDefault()`). This keeps the button in the focus order so assistive technologies can read the hint, while still semantically and functionally disabling it. diff --git a/frontend/src/components/modals/ExportModal.test.tsx b/frontend/src/components/modals/ExportModal.test.tsx index bd89c5384..2b27d8f9c 100644 --- a/frontend/src/components/modals/ExportModal.test.tsx +++ b/frontend/src/components/modals/ExportModal.test.tsx @@ -176,7 +176,9 @@ describe('ExportModal', () => { expect(screen.getByText('접근 권한 관리는 프로젝트 권한 설정에서 처리합니다.')).toBeInTheDocument(); const accessManagementButton = screen.getByRole('button', { name: '접근 관리' }); - expect(accessManagementButton).toBeDisabled(); + expect(accessManagementButton).toHaveAttribute('aria-disabled', 'true'); + accessManagementButton.focus(); + expect(accessManagementButton).toHaveFocus(); expect(accessManagementButton).toHaveAttribute('aria-describedby', 'share-export-access-hint'); expect(accessManagementButton).not.toHaveAttribute('title'); }); diff --git a/frontend/src/components/modals/ExportModal.tsx b/frontend/src/components/modals/ExportModal.tsx index 995393ceb..9ccda8ad9 100644 --- a/frontend/src/components/modals/ExportModal.tsx +++ b/frontend/src/components/modals/ExportModal.tsx @@ -202,7 +202,8 @@ export function ExportModal({ )}