[fix] combo box form element must always have a label #2608
Labels
a11y
Relates to accessibility standards and practices
good first issue
Good for newcomers
Hacktoberfest
ReactUSWDS Version: 5.4.0 & USWDS Version: 3.6.0
Describe the bug
In our storybook examples of the Combo box component, we do not always include a label.
In the USWDS docs about the combo box, it is explicitly called out that we must always use a label on this component. We should not include examples where it is unlabelled in our project storybook. The following examples lack a label:
Potentially, we should hard code a label right into the component file, and have that label's content be added as a prop to help guide react-uswds users to ensure they don't forget it in their implementations. I could be convinced of either approach, as both have pros and cons. This could be potentially cumbersome to projects already using react-uswds that have already added labels of their own who later upgrade versions.
It is also worth flagging though, that the combo box has other known accessibility issues that the USWDS team is aware of:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All visible versions of the combo box in our storybook should have labels to prevent confusion that they are optional, when they are mandatory for this component.
Additional context
src/components/forms/ComboBox/ComboBox.stories.tsx
Screenshots
The text was updated successfully, but these errors were encountered: