InputGroup + FormControl: ARIA props attach to group container instead of input; label focus and SR errors break. Wrapping input fixes ARIA but loses focus ring. Docs lack Form usage. #8446
unav4ila8le
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using the new component InputGroup with FormControl (Radix Slot), if FormControl wraps the group container, the generated id, aria-invalid, and aria-describedby are applied to the outer div[role="group"] rather than the actual .
If FormControl is moved to wrap the actual InputGroupInput, the focus ring regresses because the container’s :has() selectors target [data-slot=input-group-control], but the Slot changes the child’s data-slot to form-control, so the selectors no longer match.
I couldn’t find guidance in the InputGroup docs about usage with Form/FormControl. Docs: Input Group
Actual: id, aria-invalid, aria-describedby end up on div[role="group"]. Label click doesn’t focus input; SRs don’t announce error.
Actual: ARIA target is correct (label focuses input; SR errors work), but the group-level focus ring disappears because the :has([[data-slot=input-group-control]:focus-visible]) selector no longer matches after the Slot changes the child’s data-slot to form-control.
Any idea? Should I submit a new issue as a bug, or is this on purpose and I am not seeing it?
Beta Was this translation helpful? Give feedback.
All reactions