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

fix(FORMS-6979): Coral-Icon receives alt attribute value from wrapping Button title or icon attributes #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CristianAntoniu-Balan
Copy link
Contributor

Accessibility fix for
https://jira.corp.adobe.com/browse/FORMS-6979
https://jira.corp.adobe.com/browse/FORMS-7013

Description

Accessibility fix for wrapped inside a - the "title" or the "icon" attribute values of the button are passed down to the icon as "alt" attribute.

Related Issue

Accessibility fix for
https://jira.corp.adobe.com/browse/FORMS-6979
https://jira.corp.adobe.com/browse/FORMS-7013

Motivation and Context

Accessibility fix for
https://jira.corp.adobe.com/browse/FORMS-6979
https://jira.corp.adobe.com/browse/FORMS-7013

How Has This Been Tested?

Manual test.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

// Accessibility fix
// If the wrapping <button> has either a "title=" or an "icon=" attribute
// passes the value down to the <coral-icon> as "alt="
(this.title || this.icon) && (iconElement.alt = this.title || this.icon);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this case is only valid when button itself does not have any text content in it, secondly this code can be avoided by setting iconAutoAriaLabel to Icon.autoAriaLabel.ON

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the icon attribute doesn't seem like it would ever be satisfactory alt text. Looking at the list of icons these are not suitable as alt text. Perhaps as a fallback you could space separate instead of camel case - but even then these wouldn't be localized so it would still seem like a bad idea.

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

Successfully merging this pull request may close these issues.

None yet

3 participants