Closed darekkay closed 6 years ago
I've created PR #157 and tested the component within our application. Using inputProps
it is possible to pass aria-describedby
and override aria-label
. This makes extending the component really easy without any breaking changes.
@darekkay Thanks for the nice comments.
Both of these issues seem like good things to address. Thanks for the work!
Hi, thanks for this component and your very fast response times on GitHub :smile:
I have two somehow related WCAG issues about labeling the select component.
I need to add
aria-describedby
prop to announce my component's hint in the screen reader. However, there is no way to pass custom input props into your component.You set
aria-label
equal to the component's placeholder. This is only necessary, if theinput
has nolabel
(and usinglabel
overaria-label
is strongly encouraged). This applies only to the "searchable select" (as the regular one is just adiv
), but in this case we still need a way to override thearia-label
value. As we provide both a placeholder and alabel
, the label has no effect, asaria-label
takes precedence. This has another negative side effect: the selected value is never announced in the screen reader.I'd like to know what you think about those issues. I would contribute a PR if you find this useful (tested with NVDA screen reader).