Skip to content

[added] Apply custom data- and aria- props to content div #230

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

Closed
wants to merge 1 commit into from

Conversation

Munter
Copy link

@Munter Munter commented Sep 23, 2016

Changes proposed:

  • Apply aria-* and data-* props to the modal content div

Acceptance Checklist:

  • All commits have been squashed to one.
  • The commit message follows the guidelines in CONTRIBUTING.md.
  • Documentation (README.md) and examples have been updated as needed.
  • If this is a code change, a spec testing the functionality has been added.
  • If the commit message has [changed] or [removed], there is an upgrade path above.

@diasbruno
Copy link
Collaborator

This looks good for aria attributes.

@@ -18,6 +19,18 @@ var CLASS_NAMES = {
}
};

function getCustomProps(props) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe move this function to a helper?

@afercia
Copy link

afercia commented May 11, 2017

It would be great to have the ability to add ARIA attributes on the modal, this would be necessary for example when the modal content is mainly text:

screen shot 2017-05-11 at 16 58 53

The text inside the modal won't be announced because screen readers enter in focus mode when role=dialog is set., Using aria-describedby to target the text and optionally aria-labelledby to target the visible heading would solve the accessibility issue.

@diasbruno
Copy link
Collaborator

Hi @Munter, we have v2.0.0 available now. We could make this PR to allow the user to pass data-* attributes and later we can think about adding aria-*. Any thoughts?

@diasbruno diasbruno modified the milestone: 2.0.0 Jun 15, 2017
@Munter
Copy link
Author

Munter commented Jun 19, 2017

@diasbruno Thanks for the heads up. I switched to react-a11y-modal because this was a blocker to me. I don't have the bandwidth to port this to v2

@Munter Munter closed this Jun 19, 2017
@diasbruno
Copy link
Collaborator

@Munter no problem. Thank you.

@diasbruno
Copy link
Collaborator

@Munter Do you mind if I slice your PR and add to react-modal?

@Munter
Copy link
Author

Munter commented Jun 19, 2017

Take and modify whatever you need from this. It would be a fine addition to the library to get those features in

@WickyNilliams
Copy link
Contributor

Is this no longer supported?

@diasbruno
Copy link
Collaborator

diasbruno commented Feb 8, 2018

@WickyNilliams
Copy link
Contributor

ah... i specifically wanted data-* attributes, as hooks for targeting elements in tests

@diasbruno
Copy link
Collaborator

One option is place those attributes in a wrapper on the content <div /> or something else.

<Modal ...>
    <div data-x=... >...</div>
</Modal>

@diasbruno
Copy link
Collaborator

@WickyNilliams Can you open a new issue to make it easy to track?

@WickyNilliams
Copy link
Contributor

Yeah that's what I did eventually, but not ideal.

Sure thing! I'll make one now

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.

4 participants