Closed petermakowski closed 7 months ago
@petermakowski It seems it was fixed for Input
- would that be needed also for other input types? like select, textarea, etc?
Quite possibly, I haven't checked. Depends how label is implemented there (from what I've seen it's usually not a wrapper around input which means it needs an id to be associated with this input).
Description:
When using the Input component, clicking on the associated label does not trigger focus on the input element if no id attribute is specified for the input. The current implementation requires an id to associate the label with the input correctly.
Expected Behavior:
The Input component should automatically assign a unique id if one is not provided by the user. This ensures that the label and input elements are correctly associated, allowing for focus to be moved to the input when the label is clicked.
Actual Behavior:
Clicking on the label does not move focus to the associated input when an id is not explicitly provided. This leads to accessibility violation.
Steps to Reproduce:
Suggested Solution:
Modify the Input component to automatically generate and assign a unique id when one is not provided. This will ensure proper label-input association as per accessibility standards.