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 dialog being omitted in accessability tree #1205

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

thebreiflabb
Copy link
Contributor

This omits the modal root from getting
aria-hidden="true" added to it, which
removes the modal from the accessibility tree

Summary

The modal root component got aria-hidden="true" added to it when opening the dialog, rendering the content inside not accessible in the accessibility tree.

This adds additional ignore of the modal root component in the aria-hidden handler logic.

Test plan

I added a new test, for checking that a button outside still gets aria-hidden="true", and the modal root no longer get it. However I could not get the test to work, I tried both using document.querySelector and Comp.find as seen in the tried test. As well as with and without the {attachTo: attachToBody()} option.

I have verified the described effect/change in Storybook, as well as when using it as a component in our application.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 19, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 381db4a:

Sandbox Source
eufemia-starter Configuration

@gatsby-cloud
Copy link

gatsby-cloud bot commented Jan 19, 2022

Gatsby Cloud Build Report

DNB Eufemia Portal

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 11m

Performance

Lighthouse report

Metric Score
Performance 🔶 67
Accessibility 💚 100
Best Practices 💚 100
SEO 💚 92

🔗 View full report

@tujoworker
Copy link
Member

Thank You Sondre for the good PR ❤️ so far. I will check with @dinarosv if we should wait before this large PR or not.

@tujoworker tujoworker mentioned this pull request Feb 8, 2022
@tujoworker tujoworker force-pushed the fix/modal-accessability-hidden branch from 441c633 to 7ce12fc Compare February 8, 2022 12:54
This omits the modal root from getting
aria-hidden="true" added to it, which
removes the modal from the accessibility tree
@tujoworker tujoworker force-pushed the fix/modal-accessability-hidden branch from 7ce12fc to 381db4a Compare February 8, 2022 12:56
@tujoworker tujoworker self-requested a review February 8, 2022 12:57
Copy link
Member

@tujoworker tujoworker left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR 🙏

I fixed the tests and we will take this inn now 👍

@tujoworker tujoworker self-requested a review February 8, 2022 13:18
@tujoworker tujoworker merged commit 1d4d6f1 into main Feb 9, 2022
@tujoworker tujoworker deleted the fix/modal-accessability-hidden branch February 9, 2022 11:36
tujoworker pushed a commit that referenced this pull request Feb 9, 2022
# [9.22.0](v9.21.0...v9.22.0) (2022-02-09)

### Bug Fixes

* **Avatar:** make the radius 100% round ([06e4133](06e4133))
* avoid Modal (dialog) from being omitted in accessibility tree ([#1205](#1205)) ([1d4d6f1](1d4d6f1))
* fix InputMasked delete key usage ([0e13054](0e13054)), closes [#1113](#1113)
* **Icons:** fix svgo config ([e9326ee](e9326ee))
* **Icons:** lower icon size ([5e86696](5e86696))
* **Logo:** center logo in bounding box by using flex ([2a9eed7](2a9eed7))
* **Modal:** ensure IE11 is placing the close button to the right side ([1aab80f](1aab80f))
* **Modal:** make revalidation after Modal close work on IE11 ([c00c489](c00c489))
* **NumberUtils:** enhance missing types ([5e46814](5e46814))
* **NumberUtils:** fix IE11 issue with ([6225b9a](6225b9a))

### Features

* **Tabs:** add no_border prop ([#1279](#1279)) ([47826fd](47826fd))
* update icons: credit_note, deleted_invoice, speedometer, travel ([3b91772](3b91772))
* **Version:** run Eufemia.version in your browser console ([06e8658](06e8658))
* **VisuallyHidden:** Add VisuallyHidden component ([#1246](#1246)) ([48819d4](48819d4))
@tujoworker
Copy link
Member

🎉 This PR is included in version 9.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants