feat(blog): 드롭다운·모바일 사이드바 접근성 보강 (#87)#105
Merged
Merged
Conversation
키보드/스크린리더 사용자가 메뉴를 열고 Esc로 닫을 수 있도록 보강한다. 드롭다운(dropdown-menu): - 트리거 div -> button, 디스클로저 패턴(aria-expanded/aria-controls) - Esc로 닫고 트리거로 포커스 복귀, 장식 아이콘 aria-hidden 모바일 사이드바(mobile-sidebar): - 트리거/닫기 div -> button + aria-label(메뉴 열기/닫기) - 트리거 aria-expanded/aria-controls, 패널 role=dialog/aria-modal/aria-label - Esc 닫기 + Tab 포커스 트랩, 열림 시 닫기 버튼 포커스/닫힘 시 트리거 복귀 - 닫힌 동안 패널 inert로 화면 밖 링크를 탭 순서/스크린리더에서 제외 테스트: - mobile-sidebar 테스트를 역할/이름 기반으로 전환(아이콘 클래스 의존 제거) + aria-expanded/Esc/inert/포커스 이동 검증 추가 - dropdown-menu 테스트 신설(aria-expanded 토글/aria-controls/Esc) Closes #87 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
코드 리뷰에서 확인된 접근성 미흡사항을 보강한다. mobile-sidebar: - 리사이즈로 닫힐 때 md:hidden 트리거에 포커스를 강제하던 문제 수정: 명시적 닫기(닫기 버튼/Esc)에서만 트리거로 포커스를 되돌리도록 분기 - aria-modal="true" 제거: 배경을 inert로 만들지 않아 약속과 실제가 불일치했음. role=dialog + 포커스 트랩 + 스크롤 잠금은 유지(키보드 기준 모달 동작) dropdown-menu: - 포커스가 영역 밖으로 나가면(focusout) 닫히도록 onBlur 추가 (Tab으로 빠져나가도 열린 채 남던 문제 해결) 테스트: 리사이즈 시 포커스 비복귀 / 드롭다운 focusout 닫힘 검증 추가 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
코드 리뷰 + 반영 (commit 189a3f8)4개 관점(ARIA 시맨틱·키보드/포커스·React 정확성·테스트)으로 검토 후 적대적 검증을 통과한 항목입니다. in-scope 3건은 이번 커밋에 반영했습니다.
후속 권장 (이번 PR 범위 밖)완전한 모달 격리(배경 inert)는 패널을 portal로 body 최상위에 올리고 다른 형제에 검증
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
#87 — 드롭다운 메뉴와 모바일 사이드바의 키보드·스크린리더 접근성을 보강한다.
search-modal.tsx에 이미 구현된 Esc·포커스 트랩 패턴을 레퍼런스로 삼았다.변경 사항
드롭다운 메뉴 (
dropdown-menu.tsx)<div onClick>→<button>(디스클로저 패턴)aria-expanded(열림 상태) +aria-controls(목록 id,useId) 연결Esc로 닫고 트리거로 포커스 복귀aria-hidden모바일 사이드바 (
mobile-sidebar.tsx)<div onClick>→<button aria-label>("메뉴 열기" / "메뉴 닫기")aria-expanded/aria-controls, 패널role="dialog"/aria-modal/aria-labelEsc닫기 +Tab포커스 트랩inert— 화면 밖 링크를 탭 순서/스크린리더에서 제외 (WCAG 2.1.1/2.1.2/4.1.2/1.1.1)테스트
mobile-sidebar.test.tsx: 아이콘 클래스 의존 제거 → 역할/이름(getByRole) 기반으로 전환 + aria-expanded·Esc·inert·포커스 이동 검증 추가dropdown-menu.test.tsx신설: aria-expanded 토글 / aria-controls 연결 / Esc 닫기검증
pnpm test— 14 suites / 54 tests 통과pnpm lint— 통과 (max-warnings 0)pnpm build— 컴파일 성공Closes #87
🤖 Generated with Claude Code