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

[Masonry][Accessibility] aria-multiselectable incorrectly appears on coral-masonry element with role="row" #244

Closed
majornista opened this issue Oct 6, 2022 · 2 comments
Labels

Comments

@majornista
Copy link
Collaborator

majornista commented Oct 6, 2022

Expected Behavior

With ariaGrid="on", when the selectionMode for coral-masonry is set to "single" or "multiple", aria-multiselectable should be added to the parentElement of the coral-masonry element, which has role="grid", rather than the coral-masonry element itself, which has role="row".

Actual Behavior

With ariaGrid="on", when the selectionMode for coral-masonry is set to "single" or "multiple", aria-multiselectable gets added to the coral-masonry element itself, which has role="row", instead of the appropriate parent element with role="grid". This will be identified by automated accessibility testing tools as an invalid use of WAI-ARIA. See https://www.w3.org/TR/wai-aria-1.1/#aria-multiselectable.

Reproduce Scenario (including but not limited to)

https://opensource.adobe.com/coral-spectrum/examples/#masonry or any AEM UI using coral-masonry.

Steps to Reproduce

  1. Open https://opensource.adobe.com/coral-spectrum/examples/#masonry example.
  2. Click either of the Selection mode links labelled "single" or "multiple" to set the selection mode.
  3. Use aXe DevTools Chrome extension to scan page.
  4. aXe reports following error:

Elements must only use allowed ARIA attributes
Element Location

#example-preview #masonry

Element Source

<coral-masonry orderable="" id="masonry" layout="fixed-centered" columnwidth="250" aria-label="Masonry" ariagrid="on" role="row" class="_coral-Masonry is-loaded is-selectable" selectionmode="multiple" style="height: 600px;" aria-multiselectable="true">

To solve this problem, you need to...

Fix the following:
ARIA attribute is not allowed: aria-multiselectable="true"

Browser name/version/os (ie Chrome Version 62.0.3202.94 (Official Build) (64-bit) MacOS)

Chrome Version 105.0.5195.125 (Official Build) (arm64) MacOS

Coral Spectrum version

v4.15.2

Sample Code that illustrates the problem (use the Playground if possible)

In the code below, one can see that aria-multiselectable attribute is being added directly to the coral-masonry element rather than its parent with role="grid":

set selectionMode(value) {
value = transform.string(value).toLowerCase();
this._selectionMode = validate.enumeration(selectionMode)(value) && value || selectionMode.NONE;
this._reflectAttribute('selectionmode', this._selectionMode);
if (this._selectionMode === selectionMode.NONE) {
this.classList.remove('is-selectable');
this.removeAttribute('aria-multiselectable');
} else {
this.classList.add('is-selectable');
this.setAttribute('aria-multiselectable', this._selectionMode === selectionMode.MULTIPLE);
}
this._validateSelection();
}

Screenshots (if applicable)

majornista added a commit to majornista/coral-spectrum that referenced this issue Oct 6, 2022
majornista added a commit to majornista/coral-spectrum that referenced this issue Oct 11, 2022
@majornista
Copy link
Collaborator Author

majornista commented Oct 12, 2022

This is included in #250, so I will close this one.

majornista added a commit that referenced this issue Nov 2, 2022
…) - Selected state of the folder is not announced to the screen reader (#250)

* fix(#244): [Masonry][Accessibility] add aria-multiselectable to parent element with role="grid"

* fix(#249): [Masonry][Accessibility] Files: Main Navigation (Card View) - Selected state of the folder is not announced to the screen reader
github-actions bot pushed a commit that referenced this issue Nov 2, 2022
## [4.15.6](v4.15.5...v4.15.6) (2022-11-02)

### Bug Fixes

* **#249:** [Masonry][Accessibility] Files: Main Navigation (Card View) - Selected state of the folder is not announced to the screen reader ([#250](#250)) ([ff33df1](ff33df1)), closes [#249](#249) [#244](#244) [#249](#249)
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

🎉 This issue has been resolved in version 4.15.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant