-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Pass something besided string to getOptionLabel()
?
#4134
Comments
Also, if this is accepted, the DefinitelyTyped type should be updated |
I just realized that this breaks the |
Actually, would it make sense to log a console warning if a non-string is passed? Most people probably aren't verifying that their screen readers still work, and might do what I did: try it out with some JSX, realize it works, and leave it there. |
@jkjustjoshing Thanks for bringing this up. It's likely intended that the types in the documentation should be updated to return a Node. I will add a note to follow through on this. Regarding aria-live regions, I also agree this can break screen-readers. I'd like to propose a solution and see if this sounds good to you.
Thoughts? |
I am currently looking at accessibility within react-select and these functions are critical to it working as intended. I have linked to this issue in #4407 with the hopes of getting more attention around the desired implementation and enforcement of best practices. |
I have updated the documentation for this prop to include concerns around accessibility in #4414 which should offer more transparency about a11y implications. |
The docs for
getOptionLabel
indicate that the only valid return type is astring
.However, it seems like a return value of any React node will work, such as the following:
Should/can the docs be updated to show that anything React can render is an acceptable return type?
The text was updated successfully, but these errors were encountered: