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

Tooltip label acts like a description and obscures tooltip content #6329

Closed
nwhittaker opened this issue Jan 24, 2023 · 11 comments
Closed

Tooltip label acts like a description and obscures tooltip content #6329

nwhittaker opened this issue Jan 24, 2023 · 11 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. p - low Issue is non core or affecting less that 10% of people using the library

Comments

@nwhittaker
Copy link
Contributor

nwhittaker commented Jan 24, 2023

Summary

A tooltip's label property becomes the textual representation of the tooltip. This means that string is what is applied back to the reference element via its aria-describedby attribute. However, a label and description are two different things:

…a label should be concise, while a description is intended to provide more verbose information; a label describes the essence of an object, while a description provides more information that the user might need.1

As a result, when a tooltip is given a concise label, that label becomes the description of the reference element and the browser no longer has an accessible way to expose/apply the actual text content of the tooltip.

Actual Behavior

From the API, it's unclear that the tooltip's label property is actually behaving as the description of the reference element. If the fix is to duplicate the tooltip's text content as its label, it's unclear why the label property is required since aria-describedby falls back to an element's text content anyway.

Expected Behavior

Possibly rename the label property to a less overloaded term (e.g. "description"?) and not making it required. Otherwise, improve doc to better explain what makes for a good label.

Reproduction Sample

https://developers.arcgis.com/calcite-design-system/components/tooltip/

Reproduction Steps

Visit the tooltip doc page.
Use devtools to inspect the accessibility tree of the code sample's reference element.
Notice the reference element's description is the same as the tooltip's label and does not include any of the tooltip's text content.
Calcite QA

Reproduction Version

next.731

Working W3C Example/Tutorial

https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/

Relevant Info

It looks like a working example is still in development, but I didn't see any examples in the current work where the tooltip element had an aria-label attribute, FWIW.

Regression?

No response

Esri team

ArcGIS Field Apps

Footnotes
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby#description

@nwhittaker nwhittaker added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. a11y Issues related to Accessibility fixes or improvements. p - high Issue should be addressed in the current milestone, impacts component or core functionality 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jan 24, 2023
@github-actions github-actions bot added the ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. label Jan 24, 2023
@brittneytewks brittneytewks added needs triage Planning workflow - pending design/dev review. and removed needs triage Planning workflow - pending design/dev review. labels Feb 27, 2023
@geospatialem geospatialem added the research Issues that require more in-depth research or multiple team members to resolve or make decision. label Mar 30, 2023
@geospatialem geospatialem self-assigned this Mar 30, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Mar 30, 2023
@geospatialem geospatialem added this to the 2023 May Priorities milestone Mar 30, 2023
@geospatialem
Copy link
Member

Additional research needed on prop requirements and a11y supported.

@geospatialem geospatialem added p - low Issue is non core or affecting less that 10% of people using the library docs Issues relating to documentation updates only. estimate - 3 A day or two of work, likely requires updates to tests. and removed p - high Issue should be addressed in the current milestone, impacts component or core functionality docs Issues relating to documentation updates only. research Issues that require more in-depth research or multiple team members to resolve or make decision. 1 - assigned Issues that are assigned to a sprint and a team member. labels Apr 18, 2023
@geospatialem geospatialem added this to the 2023 July Priorities milestone Apr 18, 2023
@geospatialem
Copy link
Member

We should consider deprecating and/or removing the label prop with the aria-describedby attribute (already provided).

However, if considered removing, this would likely be considered a breaking change, but could provide clarity to the content presented in the tooltip. cc: @jcfranco

This is in line with the W3C recommendations for tooltip:

The accessible name of a tooltip can come from the contents. While, in theory, they could come from an aria-label or aria-labelledby, in most cases, using ARIA properties to provide a tooltip with an accessible name is not recommended.

Since the component provides context today (perhaps too much in some use cases), marking this as low priority, and added an estimate for mitigation, which should include a pass of the "is accessible when open" test.

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. and removed bug Bug reports for broken functionality. Issues should include a reproduction of the bug. labels Apr 18, 2023
@driskull
Copy link
Member

@geospatialem I think we should just make the label optional and update the doc to say that setting this will override the aria-describedby? What do you think?

@geospatialem
Copy link
Member

@driskull We could definitely do that. It seems like the approach provides content twice, so could create some confusion so lean towards deprecating the prop. Maybe once we move towards a breaking change release, we could consider removing altogether?

@driskull
Copy link
Member

Ok. lets deprecate the prop and make it optional for now.

@geospatialem can we see if there are any other components that have label as required where we may want to change it to be optional.

@driskull driskull self-assigned this Jun 28, 2023
@driskull driskull added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jun 28, 2023
@geospatialem
Copy link
Member

geospatialem commented Jun 28, 2023

@geospatialem can we see if there are any other components that have label as required where we may want to change it to be optional.

A quick rundown of required label props across the components:

  • action-menu - related to the text, no change
  • alert - the only label present, no change
  • chip-group - the only label present, no change
  • combobox - the only label present, no change
  • combobox-item-group - the only label present, no change (child and parent need separate labels)
  • loader - the only label present, no change
  • menu - the only label present, no change
  • menu-item - the only label present, no change (child and parent need separate labels)
  • option-group - the only label present, no change
  • pick-list-item - skipping due to deprecation
  • popover - We could change this one to also accept aria-describedby, but its optional, or a nice to have. Think as-is is fine since some folks implement rich popover content. WDYT @driskull?
  • select - the only label present, no change
  • tooltip - part of this issue
  • value-list-item - skipping due to deprecation

@driskull
Copy link
Member

@geospatialem can we update both popover and tooltip to deprecate label and make it optional? I think that would be good.

@geospatialem
Copy link
Member

can we update both popover and tooltip to deprecate label and make it optional? I think that would be good.

We can definitely do so for both as long as we include an aria-labelledby in for the popover's reference element.

@driskull
Copy link
Member

I'll leave popover alone since I know MV and some apps use a reference element just for positioning only.

@driskull driskull added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jun 29, 2023
driskull added a commit that referenced this issue Jun 30, 2023
…ing from the component's content (#7247)

**Related Issue:** #6329

## Summary

- Deprecates the `label` property.
- The already provided `aria-describedby` attribute is sufficient for
accessibility.
  - Setting aria attributes on the component is not recommended.
- Can still be set by user so no breaking changes.
- Set to optional by default so its no longer required.
- Update tests
- Update Storybook
- Update HTML
@driskull driskull added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jun 30, 2023
@github-actions github-actions bot assigned geospatialem and unassigned driskull Jun 30, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jun 30, 2023
@geospatialem
Copy link
Member

Verified in master with JAWS and NVDA on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. p - low Issue is non core or affecting less that 10% of people using the library
Projects
None yet
Development

No branches or pull requests

6 participants