[Feature/#318] 모달 focus trap 및 키보드 네비게이션 구현 - #321
Conversation
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough모달 내부 포커스 가능 요소를 탐색하는 선택자를 추가하고, 모달 오픈 시 첫 요소로 포커스를 이동하도록 변경했습니다. Tab 및 Shift+Tab 입력 시 포커스가 모달 내부에서 순환하도록 키보드 이벤트를 연결했습니다. Changes모달 포커스 트랩
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/common/modal/Modal.tsx`:
- Around line 80-104: Update handleKeyDown in Modal so a Tab press is prevented
even when no focusable descendants are found, keeping focus within the modal
rather than allowing browser focus to move outside it. Preserve the existing
first/last focus wrapping behavior when focusable elements exist.
- Around line 17-24: Update the focusable-element handling around
FOCUSABLE_SELECTORS so both initial modal focus and Tab navigation use one
shared visibility/accessibility helper. Filter candidates to tabIndex >= 0,
non-empty getClientRects(), visible computed styles, and ancestors without
aria-hidden or inert; ensure hidden inputs such as Workspace’s
className="hidden" file input are excluded before focus is attempted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6ad3e69d-b8b8-45df-9fee-ab71221b6228
📒 Files selected for processing (1)
src/components/common/modal/Modal.tsx
🚨 관련 이슈
#318
✨ 변경사항
✏️ 작업 내용
😅 미완성 작업
N/A
📢 논의 사항 및 참고 사항
ESC 닫기(handleEscape)와 포커스 복원(previousActiveElement)은 기존 Modal.tsx에 이미 구현되어 있음
이번 PR에서는 누락된 Tab focus trap과 오픈 시 첫 번째 요소 자동 포커스만 추가했습니다.
WCAG 2.1 AA 기준:
Summary by CodeRabbit
Tab키 사용 시 포커스가 모달 외부로 빠져나가지 않도록 순환 이동을 지원합니다.