[EuiAccordion] Fixed a bug in aria-expanded for axe-core.#6694
Merged
1Copenut merged 7 commits intoelastic:mainfrom Apr 6, 2023
1Copenut:bug/euiAccordion-aria-expanded-interactive
Merged
[EuiAccordion] Fixed a bug in aria-expanded for axe-core.#66941Copenut merged 7 commits intoelastic:mainfrom 1Copenut:bug/euiAccordion-aria-expanded-interactive
1Copenut merged 7 commits intoelastic:mainfrom
1Copenut:bug/euiAccordion-aria-expanded-interactive
Conversation
* Added logic check for EuiAccordion aria-expanded attr. * Adding comment for new logic reasoning.
EuiAccordion aria-expanded for axe.|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6694/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6694/ |
1Copenut
commented
Apr 6, 2023
| className={buttonClasses} | ||
| aria-controls={id} | ||
| aria-expanded={isOpen} | ||
| aria-expanded={isExpandableButton ? isOpen : undefined} |
Contributor
Author
There was a problem hiding this comment.
Jest and Cypress tests broke in local testing while I was working through this logic, so I've got high confidence in this approach. The two snapshot test changes were using div | fieldset for the ButtonElement which is what I expected.
cee-chen
reviewed
Apr 6, 2023
cee-chen
reviewed
Apr 6, 2023
cee-chen
reviewed
Apr 6, 2023
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6694/ |
jbudz
added a commit
to elastic/kibana
that referenced
this pull request
Apr 18, 2023
EUI `77.0.0` ➡️ `77.1.1` ## [`77.1.0`](https://github.com/elastic/eui/tree/v77.1.0) - Updated `EuiDatePicker` to display a warning icon and correctly set `aria-invalid` when `isInvalid` is passed ([#6677](elastic/eui#6677)) - Updated `EuiFilePicker` to display an alert icon when `isInvalid` ([#6678](elastic/eui#6678)) - Updated `EuiTextArea` to display an alert icon when `isInvalid` ([#6679](elastic/eui#6679)) - Updated `EuiTextArea` to support the `isLoading` prop ([#6679](elastic/eui#6679)) - Updated `EuiComboBox` to display a warning icon and correctly set `aria-invalid` when `isInvalid` is passed ([#6680](elastic/eui#6680)) **Bug fixes** - Fixed `EuiAccordion` to not set an `aria-expanded` attribute on non-interactive `buttonElement`s ([#6694](elastic/eui#6694)) - Fixed an `EuiPopoverFooter` bug causing nested popovers within popovers (note: not a recommended use-case) to unintentionally override its panel padding size inherited from context ([#6698](elastic/eui#6698)) - Fixed `EuiComboBox` to only delete the last selected item on backspace if the input caret is present ([#6699](elastic/eui#6699)) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jon <jon@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
EuiAccordioncomponent was throwing an axe-core violation when we included interactive content in the trigger. This was due to non-button elements receiving anaria-expandedattribute. This PR adds a logic check to only render thearia-expandedattribute on buttons, and in the correct state.Closes #6689
QA
Remove or strikethrough items that do not apply to your PR.
General checklist
@defaultif default values are missing) and playground toggles