Skip to content
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(drawer): Fix trapped focus in the drawer #1467

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

artemtrusov-cengage
Copy link
Collaborator

Issue: #1241

What I did

A filtering function was added to the useFocusLock hook, which filters out invisible elements that were being included in the focusableItems.current array and preventing the focus from being properly locked on the modal window.

Screenshots:

Checklist

  • changeset has been added
  • Pull request description is descriptive
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

How to test

  1. Go to our documentation site.
  2. Navigate to Components > Drawer
  3. Click "Show Drawer" under "Navigation Example"
  4. Tab through the opened Drawer

@artemtrusov-cengage artemtrusov-cengage added bug Something isn't working a11y Issues related to accessibility ready for review Pull requests that are ready for developer review labels Oct 1, 2024
@artemtrusov-cengage artemtrusov-cengage self-assigned this Oct 1, 2024
Copy link

changeset-bot bot commented Oct 1, 2024

🦋 Changeset detected

Latest commit: 8dad993

The changes in this PR will be included in the next version bump.

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

@artemtrusov-cengage artemtrusov-cengage linked an issue Oct 1, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Oct 1, 2024

Copy link
Contributor

github-actions bot commented Oct 1, 2024

@silvalaura
Copy link
Collaborator

This solution also addresses #970

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just need to add .md to the filename so the changeset is detected

@artemtrusov-cengage artemtrusov-cengage linked an issue Oct 2, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Copy link
Contributor

github-actions bot commented Oct 2, 2024

@silvalaura silvalaura merged commit 35d9507 into dev Oct 2, 2024
2 checks passed
@silvalaura silvalaura deleted the fix/DrawerNavigationFocus branch October 2, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues related to accessibility bug Something isn't working ready for review Pull requests that are ready for developer review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drawer - Focus not trapped properly when open Modal/Drawer: Focus lock breaks with specific content
2 participants