-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor/285/모달접근성개선 #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Refactor/285/모달접근성개선 #287
The head ref may contain hidden characters: "Refactor/285/\uBAA8\uB2EC\uC811\uADFC\uC131\uAC1C\uC120"
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cksrlcks
approved these changes
Apr 8, 2025
Collaborator
cksrlcks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다.
드롭다운쪽 충돌건 수정해서 커밋해두었습니다!
그리고 민서님처럼 드롭다운에서 사용되는 포커스트랩 함수를 분리해두었어요! 👍
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.
❓이슈
📝 Description
노션 보러가기
1.
focusTrap유틸 함수 추가Tab및Shift + Tab키를 통해 모달 내 포커스가 순환되도록focusTrap유틸 함수를 구현했습니다.2. 초기 포커스 제어 기능 추가
useLayoutEffect를 통해 자동으로 내부의 첫 번째input요소나initialFocusRef로 지정된 요소에 포커스를 이동시킵니다.<input>이 없는 경우, 모달 내부에 숨겨진tabIndex={-1}포커스용 요소를 추가하고, 모달이 열릴 때 해당 요소에 강제로 포커스를 줘서 포커스트랩이 올바르게 동작하도록 구현하였습니다.setTimeout을 사용해 렌더 이후 포커스가 정확히 작동되도록 타이밍을 조정했습니다.ProfileEditModal이 열릴 때,UploadPreview내부의file input에 포커스가 가게 하는 게 목표였습니다. 그런데file input이 아직 마운트 안 되었을 때 포커스를 실행해setTimeout(() => ..., 0)으로 포커스를 한 틱 늦춰 실행하여 해결하였습니다.3.
ModalBase내aria속성 및 역할(role) 추가role="dialog"와aria-modal="true"를 추가했습니다.aria-labelledby로 제목 요소와 연결되도록titleIdprops를 통해 관리합니다.aria-hidden으로 접근 불가 영역임을 명시했습니다.4. 모달 사용하는 컴포넌트에도 제목 요소 연결
ModalBase를 사용하는 컴포넌트에titleIdprops를 전달하고, 실제<h2>요소와id를 매칭하여 스크린 리더가 읽을 수 있도록 설정했습니다.<h2>는 시각적으로 숨기되(sr-only), 접근성 상 제목으로 인식되도록 처리했습니다.5. 결과
modal-a11y-improvement.mp4
🌀 PR Type
어떤 변경 사항이 있나요?
PR