Skip to content
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

Merged
merged 15 commits into from
Jan 29, 2020
Merged

Conversation

miukimiu
Copy link
Contributor

@miukimiu miukimiu commented Jan 22, 2020

Summary

Closes #762

When using just one EuiFormRow inside a EuiDescribedFormGroup the EuiDescribedFormGroup 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 the id of the EuiDescribedFormGroup 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 a EuiFormRow help-text prop or an aria-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

  • Removed idAria prop from EuiDescribedFormGroup

Suggested upgrade

  • Remove idAria prop usage on any EuiDescribedFormGroup components being used in your application.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

Copy link
Contributor

@myasonik myasonik left a 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.

Copy link
Contributor

@andreadelrio andreadelrio left a 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

image

to this

image

src-docs/src/views/form_layouts/form_layouts_example.js Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
miukimiu and others added 3 commits January 23, 2020 12:45
Co-Authored-By: Andrea Del Rio <delrio.andre@gmail.com>
Co-Authored-By: Andrea Del Rio <delrio.andre@gmail.com>
Copy link
Contributor

@snide snide left a 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"

Copy link
Contributor

@snide snide left a 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.

@miukimiu miukimiu merged commit 5a8a1c7 into elastic:master Jan 29, 2020

<EuiFlexGroup gutterSize={gutterSize}>
<EuiFlexItem>
<span ref={ref} title={innerText}>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

thompsongl added a commit that referenced this pull request Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve EuiDescribedFormGroup accessiblity
5 participants