-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECHOES-568 Migration Fixes #257
Conversation
✅ Deploy Preview for echoes-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
label={label} | ||
labelProps={{ | ||
// We no longer use Mantine's InputLabel component. However, if we | ||
// do not pass a `label` prop to the Select component, Mantine will | ||
// render an `aria-label` on the OptionsDropdown component. This | ||
// causes the input and the dropdown to have the same label, which | ||
// is problematic for accessibility. | ||
labelElement: Null, | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we did that we would have the same issue, that 2 elements have the same label (the input and the dropdown). I'm a little confused how the the dropdown component is even getting that label id 🤔. It's just adding the -label
suffix to the id
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably inferring it from the parent element id we are passing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this example on MDN, the input and dropdown have different labels. The input as an aria-controls
that points to the id
of the drop-down menu.
However, on https://echoes-react.netlify.app/?path=/story/echoes-select-select--default, the input's aria-controls
does not match the id
of the drop-down element, but in your screenshot it does? 🤔
What I can take away from this:
- The input should have an
aria-controls
that points to theid
of the drop-down menu. - The input and drop-down should have different labels.
Neither of these seem correct in Mantine on my end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aria-controls
changes once you open the drop-down menu. But it is incorrect until the drop-dowm menu opens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so given what you are saying, we want to keep the labelElement: Null to avoid having duplicate labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the aria-controls situation, this is weird. When looking at Mantine documentation, they actually don't provide the aria-controls when the dropdown isn't open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so given what you are saying, we want to keep the labelElement: Null to avoid having duplicate labels.
Yeah, I'm not seeing any way to provide a different label for the drop-down menu element in the source code. In that case do you think this change is acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think it's acceptable
ECHOES-568
There are a bunch of tests failing in the product because Mantine is adding the same label to the input element and option dropdown wrapper element.