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

[Action Bar] Add aria-expanded to expand/collapse button #7003

Open
geospatialem opened this issue May 23, 2023 · 14 comments
Open

[Action Bar] Add aria-expanded to expand/collapse button #7003

geospatialem opened this issue May 23, 2023 · 14 comments
Labels
0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. blocked This issue is blocked by another issue. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library spike complete Issues that have a research spike completed and dev work can proceed
Milestone

Comments

@geospatialem
Copy link
Member

Summary

Add context to the action-bar's expand/collapse button when it is expanded. Surfaced as part of MapViewer's a11y audit in the Spring of 2022.

Actual Behavior

Context is provided if the action can be collapsed or expanded. However, no context is provided for AT to know an expansion or collapse has taken place.

Expected Behavior

Announce if the component is expanded or collapsed to AT by adding an aria-expanded property (true/false) boolean, which provides additional context to AT.

Reproduction Sample

https://developers.arcgis.com/calcite-design-system/components/action-bar/#sample

Reproduction Steps

  1. Open a screen reader of choice (VoiceOver, NVDA, or JAWS)
  2. Open the Developer site sample
  3. Navigate via keyboard to the "Expand/Collapse" action
  4. Observe while the context is provided if the action can be collapsed or expanded, no context is provided for AT to know an expansion or collapse has taken place

Reproduction Version

1.4.0

Working W3C Example/Tutorial

No response

Relevant Info

No response

Regression?

No response

Priority impact

p4 - not time sensitive

Esri team

Calcite (dev)

@geospatialem geospatialem added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. a11y Issues related to Accessibility fixes or improvements. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. p - medium Issue is non core or affecting less that 60% of people using the library ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. estimate - 2 Small fix or update, may require updates to tests. labels May 23, 2023
@github-actions github-actions bot added impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive Calcite (dev) Issues logged by Calcite developers. labels May 23, 2023
@geospatialem geospatialem added needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Aug 7, 2023
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Sep 6, 2023
@driskull driskull added the good first issue Issues that can be worked on by contributors new to calcite-components. label Sep 21, 2023
@brittneytewks brittneytewks added the low risk Issues with low risk for consideration in low risk milestones label Sep 21, 2023
@driskull
Copy link
Member

@geospatialem one issue I'm seeing here is that calcite-action already has a active property which translates to aria-pressed. It seems like both aria-pressed and aria-expanded are conflicting with each other.

Should we maybe refactor this so they can't both be set? Is there some workaround for when the following happens?

<button aria-expanded="true" aria-pressed="true">
  Toggle
</button>

@geospatialem
Copy link
Member Author

@geospatialem one issue I'm seeing here is that calcite-action already has a active property which translates to aria-pressed. It seems like both aria-pressed and aria-expanded are conflicting with each other.

Should we maybe refactor this so they can't both be set? Is there some workaround for when the following happens?

That sounds like a good plan forward.

It looks like aria-pressed is associated with the active property, does that sound right?

If so, @driskull - what would you think about removing aria-pressed, which shouldn't indicate a "selected" or "active" state, but rather adds "press" context for AT users. And instead consider a new translation to the button's aria-label indicating its active state, similar to what is added when indicator is true?

const ariaLabel = `${label || text}${indicator ? ` (${messages.indicator})` : ""}`;

@driskull
Copy link
Member

It looks like aria-pressed is associated with the active property, does that sound right?

Yes, correct.

what would you think about removing aria-pressed, which shouldn't indicate a "selected" or "active" state, but rather adds "press" context for AT users. And instead consider a new translation to the button's aria-label indicating its active state, similar to what is added when indicator is true?

Shouldn't we keep aria-pressed because some of these buttons are toggle buttons. right? active means that its "on". If we remove it, we lose that context. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed

@driskull
Copy link
Member

I think we'll need to setup some time to discuss a plan moving forward here.

We already have a property for toggling (active) but we don't have a property for expand status. We would need a new property to handle this because aria-expanded needs to be added to the internal button element.

@geospatialem
Copy link
Member Author

We already have a property for toggling (active) but we don't have a property for expand status. We would need a new property to handle this because aria-expanded needs to be added to the internal button element.

Ah, gotcha, thanks for the context - was initially thinking the action component was providing a selection state, rather than leveraging aria-pressed - it's more clear now.

Concur with your original statement above- we'd want to ensure aria-pressed and aria-expanded aren't used together with the action-bar, and when the component is expanded, ensure aria-expanded takes precedence. Per your proposal above, a new property with conditions sounds like the best path forward, if you still agree?

@driskull
Copy link
Member

driskull commented Jan 2, 2024

Yes, I agree. We'll have to deprecate active and have a new property for handling toggled/expanded state.

@driskull
Copy link
Member

driskull commented Jan 3, 2024

I guess we would have to add something like:

state: "pressed" | "unpressed" | "expanded" | "collapsed";
state: "on" | "off" | "expanded" | "collapsed";
state: "active" | "inactive" | "expanded" | "collapsed";

Would we need to support the mixed state of aria-pressed?

@driskull
Copy link
Member

driskull commented Jan 3, 2024

When something is "expanded" would it get the same background color affordance as when "pressed/active"?

@geospatialem geospatialem added this to the 2024-04-30 - Apr Release milestone Mar 25, 2024
@driskull
Copy link
Member

driskull commented Apr 6, 2024

I guess we could just add an expanded property on action which would take precedence over active? What do you think? is that easier than a single mode?

@driskull
Copy link
Member

I think this needs a design/api discussion before it can move forward.

@geospatialem geospatialem added design Issues that need design consultation prior to development. needs triage Planning workflow - pending design/dev review. labels May 31, 2024
@jcfranco jcfranco changed the title [Action Bar] Add aria-collapsed to expand/collapse button [Action Bar] Add aria-expanded to expand/collapse button Jun 4, 2024
@geospatialem geospatialem added the spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. label Jun 4, 2024
@geospatialem geospatialem added this to the 2024-06-25 - Jun Release milestone Jun 4, 2024
@geospatialem geospatialem added the spike complete Issues that have a research spike completed and dev work can proceed label Jun 4, 2024
@github-actions github-actions bot added needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. labels Jun 4, 2024
Copy link
Contributor

github-actions bot commented Jun 4, 2024

cc @geospatialem, @brittneytewks

@github-actions github-actions bot removed this from the 2024-06-25 - Jun Release milestone Jun 4, 2024
@geospatialem geospatialem removed needs triage Planning workflow - pending design/dev review. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. good first issue Issues that can be worked on by contributors new to calcite-components. low risk Issues with low risk for consideration in low risk milestones labels Jun 4, 2024
@geospatialem geospatialem added this to the Freezer milestone Jun 4, 2024
@geospatialem geospatialem added the blocked This issue is blocked by another issue. label Jun 4, 2024
@geospatialem
Copy link
Member Author

The above is blocked and sending to the freezer 🥶 until accessibility API supports shadow DOM further for implementation. As this is not currently feasible within shadow DOM, since the component relies on an internal button via the shadow DOM.

Some resources for consideration and checking on the Accessibility object model (AOM), once supported:

@geospatialem geospatialem removed the design Issues that need design consultation prior to development. label Jun 4, 2024
@driskull
Copy link
Member

driskull commented Nov 6, 2024

If we add a property of type to calcite-action of type: "button" | "toggle" | "expand" that would get us closer.

We could use active for toggle and expand or we could add another property just for expanded. Thoughts here? @jcfranco @geospatialem

Maybe we deprecate active and have selected and expanded added.

@driskull
Copy link
Member

driskull commented Nov 6, 2024

The reason we need a different type for expand is that expand uses aria-expanded instead of aria-pressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. blocked This issue is blocked by another issue. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library spike complete Issues that have a research spike completed and dev work can proceed
Projects
None yet
Development

No branches or pull requests

3 participants