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

Improve documentation, naming, and/or error messages around 'label' and 'isLabelVisible' prop #66

Open
jackkoppa opened this issue Jan 8, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@jackkoppa
Copy link
Contributor

In using this component, we've discovered that it's not super clear how label is expected to be used as a prop: it's marked as required and throws errors if not provided, but sometimes a consuming app won't want to display a text label above the select.

The reason we have it required is because, regardless of whether the label is displayed, some value should be provided to tell screen readers what the select is. So, if the label isn't needed visually, devs should set :isLabelVisible="false"

So, we need to document this better. My current idea is to add validation to the label property - rather than marking it as required, add a validation hook where, if it's not passed in, we can console.warn that the component won't be accessible to screen readers when a label is not provided. If you'd like it to not display visually, simply set isLabelVisible

There are probably other approaches we could take as well

@jackkoppa jackkoppa added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Jan 8, 2021
@hungsu
Copy link
Contributor

hungsu commented Jan 8, 2021

Thanks for this issue Jack!

I'd oppose removing the required aspect of that prop. If a person wants to use something called vue-accessible-select, they should fill out that prop.

@jackkoppa
Copy link
Contributor Author

Sounds great to me 👍

Yeah, I think the goal is to figure out how we can improve the error message when a prop isn't set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants