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

The UnstyledLink component should support the role prop #540

Closed
nicklemmon opened this issue Jul 14, 2020 · 1 comment · Fixed by #542
Closed

The UnstyledLink component should support the role prop #540

nicklemmon opened this issue Jul 14, 2020 · 1 comment · Fixed by #542
Assignees

Comments

@nicklemmon
Copy link
Contributor

🚀 Feature request

Current Behavior

For Hibana only, <UnstyledLink role="button"/> does not successfully render to the DOM as <a role="button"/>.

Desired Behavior

I should be able to modify the role of a link while using Matchbox.

Suggested Solution

Pass on the value of the role prop to the rendered anchor tag.

Who does this impact? Who is this for?

This largely helps screen reader users when links open modals instead of navigating to new pages.

@jonambas
Copy link
Contributor

jonambas commented Jul 15, 2020

Are you using a wrapper component by any chance? We pass through role but only if it (1) does not have a wrapper and (2) does not have an onClick.

See: https://github.com/SparkPost/matchbox/blob/main/packages/matchbox/src/components/UnstyledLink/UnstyledLink.js#L12

jonambas added a commit that referenced this issue Jul 20, 2020
…o links (#542)

* Pass through role to UnstyledLinks with wrapper components

* Pass through role to all UnstyledLinks

* Fix a typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants