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

feat: Added ariaHidden to Modal component Props. #456

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

yosipy
Copy link
Contributor

@yosipy yosipy commented Aug 26, 2024

If elements that can receive focus are to be included in Modal's children, they must be aria-hidden="false". However, there is no option to specify aria-hidden, so I would like to add it.

If using props.backdrop, the user would set props.open=undefined. Therefore, the ability to specify aria-hidden independent of the value of props.open would be beneficial.

The addition of this feature does not affect existing operation. When props.ariaHidden is undefined, the behavior is the same as before.

mdn states the following:

aria-hidden="true" should not be used on elements that can receive focus. Additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element.

Copy link

netlify bot commented Aug 26, 2024

👷 Deploy Preview for react-daisyui processing.

Name Link
🔨 Latest commit eb2e152
🔍 Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/66ccd6710a48620008cbfc6f

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for react-daisyui ready!

Name Link
🔨 Latest commit eb2e152
🔍 Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/66ccd6710a48620008cbfc6f
😎 Deploy Preview https://deploy-preview-456--react-daisyui.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

netlify bot commented Aug 26, 2024

👷 Deploy Preview for react-daisyui processing.

Name Link
🔨 Latest commit eb2e152
🔍 Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/66ccd6710a48620008cbfc6f

@yosipy yosipy changed the title Added ariaHidden to Modal component Props. feat: Added ariaHidden to Modal component Props. Aug 26, 2024
Copy link
Collaborator

@benjitrosch benjitrosch left a comment

Choose a reason for hiding this comment

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

@yosipy thanks for catching this and submitting a PR. LGTM!

@benjitrosch benjitrosch merged commit 45fa820 into daisyui:main Aug 27, 2024
3 of 4 checks passed
benjitrosch pushed a commit that referenced this pull request Aug 28, 2024
* feat(Modal): added ariaHidden to Modal component Props. (#456)

* fix(Modal): fixed Props type to use DialogHTMLAttributes

* refactor: remove ModalLegacyProps as it is not used
This was referenced Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants