-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fix escape key logic for popover components in Modal #2531
Conversation
🦋 Changeset detectedLatest commit: ab3ec13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +27 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
@@ -82,9 +82,11 @@ const ModalView = React.forwardRef( | |||
? { | |||
initialFocus: `#${id} ${initialFocus}`, | |||
fallbackFocus: `#${closeId}`, | |||
escapeDeactivates: false, |
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.
nice
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.
It looks like the focus trap is not working after hitting esc: https://jmp.sh/AnGePGEd. On esc, the focus goes to the date picker trigger. If I hit tab, the focus moves to the close button, and another tab moves the focus outside the modal.
And in this recording, the focus moves to the original trigger if i hit esc when a select is open: https://jmp.sh/P70W5mcO
✍️ Proposed changes
🎟 Jira ticket: Name of ticket
✅ Checklist
For bug fixes, new features & breaking changes
yarn changeset
and documented my changes🧪 How to test changes
Main branch chromatic instance (broken focus trap): https://642700aa3e49e32bdbf0b0fc-vclacfpgcn.chromatic.com/?path=/story/components-datepicker-datepicker--in-modal
Open this PR's chromatic instance from build checks and in
DatePicker/InModal
storybook example: