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

Added trap focus and focus redirection #14877

Merged

Conversation

guidari
Copy link
Contributor

@guidari guidari commented Oct 11, 2023

Closes #14691

Enhanced the ActionableNotification component by implementing trap focus functionality, alongside the addition of a tabIndex attribute to the parent div. This enhancement ensures that when a user receives a notification with the hasFocus prop set to true, the focus is correctly directed to the component.

Changelog

New

  • Added the trap focus functionality;
  • Added tabIndex in the parent div.

Testing / Reviewing

  • Check if the focus is trapped in the notification
  • Check if the focus is working correctly in the TestFocus variant

  • Delete the TestFocus variant

@guidari guidari requested a review from a team as a code owner October 11, 2023 18:47
@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 037dd26
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/654bc6f81663d30008eb86ca
😎 Deploy Preview https://deploy-preview-14877--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 037dd26
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/654bc6f842d6b20008efec16
😎 Deploy Preview https://deploy-preview-14877--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Just a couple thoughts here relating to the a11y failure in the tests

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ✅

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Looks good but we need to remove the test story. I'll do it real quick

@github-actions github-actions bot added this pull request to the merge queue Nov 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 8, 2023
@andreancardona andreancardona added this pull request to the merge queue Nov 8, 2023
Merged via the queue into carbon-design-system:main with commit 6d2b92c Nov 8, 2023
21 checks passed
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
* fix: added trap focus and focus redirection

* test: added test to match tabIndex

* fix: fixed focus issues to action button

* chore: remove test story

* fix: fixed test

* fix: fixed avt test to match component

---------

Co-authored-by: TJ Egan <tw15egan@gmail.com>
Co-authored-by: Taylor Jones <taylor.jones826@gmail.com>
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[a11y]: ActionableNotification - Screen Reader focus is not trapped within the alertdialog
5 participants