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

Allow inputAttributes to override existing attributes #202

Closed
Herdismaria opened this issue Apr 29, 2020 · 3 comments · Fixed by #203
Closed

Allow inputAttributes to override existing attributes #202

Herdismaria opened this issue Apr 29, 2020 · 3 comments · Fixed by #203

Comments

@Herdismaria
Copy link
Contributor

Describe the solution you'd like

We can already add attributes to the input via the inputAttributes props. However it would be nice if we could override all/some of the existing attributes. For example the aria-label. Now it uses the placeholder but sometimes the placeholder is just a hint and not clear enough for users using screen readers.

A clear and concise description of what you want to happen.
I want to be able to override the aria-label.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@i-like-robots
Copy link
Owner

i-like-robots commented Apr 29, 2020

You've raised an interesting point @Herdismaria - placeholders serve a different purpose to labels and are not equivelent. Perhaps adding a new label option (which could also output a <label> element?) would be useful addition. I think I'd rather introduce an explicit option than allowing anybody to trip themselves up by changing an internal detail. What do you think?

@Herdismaria
Copy link
Contributor Author

Label could work and would be a nice addition. However some use cases don't involve a label so it would need to be optional and allow some custom styling, I guess.
The simples solution to the aria-label problem would probably be to just add a prop for it, make it optional and default to the label/placeholder?

@i-like-robots
Copy link
Owner

Sounds good to me. Are you happy to submit a PR for this?

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