-
Notifications
You must be signed in to change notification settings - Fork 844
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
Described form group a11y #2783
Described form group a11y #2783
Conversation
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.
Will this cause a breaking change in Kibana?
My comments are for further improvements but shouldn't block this PR. If they can't get into this PR, let's make a new issue for them.
Also, reading #762, I think there's a good suggestion in there to limit EuiTitle
to only allow h1
- h6
children. If we're going to close that ticket, we should make a new one for that as well.
src/components/form/described_form_group/described_form_group.js
Outdated
Show resolved
Hide resolved
src/components/form/described_form_group/described_form_group.js
Outdated
Show resolved
Hide resolved
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'll leave the review of the a11y stuff to Michael. Just added a couple of small suggestions.
Also, now that you're in that code maybe we can change the size here (title of the "Multiple fields" example) to s
. Right now "Multiple Fields" kind of looks like it's another section (at 28px) and at least for me, since it was the first time looking at that page in our docs it was confusing
to this
Co-Authored-By: Andrea Del Rio <[email protected]>
Co-Authored-By: Andrea Del Rio <[email protected]>
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.
Agree with @myasonik. Fieldset feels better if possible. Removing the prop will make this a technical breaking change. When we're removed a prop like this we've generally flipped a coin as to whether we mark it as breaking since the downstream components would still work fine and at works will spit out a console error. This is used so commonly in Kibana though that it's probably best to mark it as such. When you get ready to merge this please write up the upgrade path in your PR description. I'd assume that should simply be "Remove the idAria
prop...etc"
src/components/form/described_form_group/described_form_group.js
Outdated
Show resolved
Hide resolved
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.
LGTM. Did another review of the code and tested the output in a Screen reader.
|
||
<EuiFlexGroup gutterSize={gutterSize}> | ||
<EuiFlexItem> | ||
<span ref={ref} title={innerText}> |
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.
@miukimiu Quick question, why is the title
prop needed 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.
I copied the code from the InnerText snippet and I must have missed it. I can remove it on #2810 or create a different PR.
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.
Cool, yeah I think in #2810 would be fine
Summary
Closes #762
When using just one
EuiFormRow
inside aEuiDescribedFormGroup
theEuiDescribedFormGroup description
text was served as the help text for the input. This was causing the text to be read twice by screen readers.Once when users were reading the description and again when users are inside the input. This input was getting an
aria-describedby
with theid
of theEuiDescribedFormGroup description
.I think it's not a good idea to use the
EuiDescribedFormGroup description prop
as a way to display help text for the input. If users want to create a help text for the input they should use aEuiFormRow help-text prop
or anaria-label
on the form element.The
EuiDescribedFormGroup description
should be used to provide an additional text and not as a help text for a form element.Breaking change
idAria
prop fromEuiDescribedFormGroup
Suggested upgrade
idAria
prop usage on anyEuiDescribedFormGroup
components being used in your application.Checklist