Why InputGroup automatically set the aria-describedby to a "form-control" child?
#5954
-
|
Hi there! Excuse me for the noob question, but I do not get why the Despite reading the code and searching on the Github repository, I haven't found anything more than evidence that it was done on purpose. Even looking at the PatternFly examples... the behavior there don't make sense to me. Consider an import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon';
import { Button, InputGroup, InputGroupItem, TextInput } from '@patternfly/react-core';
export default function Example() {
return (
<InputGroup>
<InputGroupItem isFill>
<TextInput id="password" type="password" aria-label="User password field" />
</InputGroupItem>
<InputGroupItem>
<Button id="button-id" variant="control" icon={<EyeIcon />} />
</InputGroupItem>
</InputGroup>
);
}Looking at the code, it's clear that the "workaround" is setting the I really appreciate your help to understand the rationale of that behavior. Thanks a lot in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
|
Hey @dgdavid , thanks for bringing this up! After discussing this with some on the team, what you've mentioned in your original post makes sense and is accurate. Ideally what we'd want to do is:
We concluded that this is more of a bug fix than breaking change, so I'll create an issue from this discussion, thanks again for bringing this to our attention! |
Beta Was this translation helpful? Give feedback.

Hey @dgdavid , thanks for bringing this up!
After discussing this with some on the team, what you've mentioned in your original post makes sense and is accurate. Ideally what we'd want to do is:
aria-describedbyattribute, and have it simply be something passed by the consumer when applicable like most/all of our other componentsaria-describedbywould make senseWe concluded that this is more of a bug fix than breaking change, so I'll create an issue from this discussion, thanks again for bringing this to our attention!