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

Button and use of ARIA #642

Closed
sirrah-tam opened this issue Oct 25, 2023 · 1 comment
Closed

Button and use of ARIA #642

sirrah-tam opened this issue Oct 25, 2023 · 1 comment

Comments

@sirrah-tam
Copy link
Contributor

Expected behavior
As a Pharos consumer I want to be able to utilize ARIA appropriately while using the Pharos button. When used appropriately, these attributes add much needed context for users of assistive technology to interactive elements so they have clear purpose and behave as expected.

Actual behavior
Pharos consumer currently can pass in label attribute to add the aria-label as well as the pressed to pass in the aria-pressed attribute to the underlying <button> element when constructing the custom web component for a button.

However, there are additional uses of ARIA that are useful to convey various states of a button and their association with other bits of content on the page. Consumers are unable to apply the following commonly used ARIA attributes successfully to the Pharos button:

  • aria-expanded
  • aria-haspopup
  • aria-description (not fully supported by browsers but can be used)
  • Full list

The following rely on an ID reference that does not work from light to shadow DOM & vice versa:

  • aria-labelledby
  • aria-describedby
  • aria-controls

Consumers may attempt to apply aria attributes directly to the Pharos component itself however it is often not parsed correctly while using assistive technology and this context is lost.

Steps to reproduce the issue

  1. Apply the ARIA above directly to the Pharos button and validate in Chrome inspector it's accessibility properties.

Screenshots or code

          <button
            id="button-element"
            name="${ifDefined(this.name)}"
            value="${ifDefined(this.value)}"
            ?autofocus=${this.autofocus}
            ?disabled=${this.disabled}
            type="${ifDefined(this.type)}"
            aria-label=${ifDefined(this.label)}
            aria-pressed=${ifDefined(this.pressed)}
          >
            ${this.buttonContent}
          </button>
        ;

Pharos version
13.2.2

Your environment

  • OS: macOS 13.6, Windows 10
  • Browser: Chrome, Firefox, Safari
  • Version: 118.0.5, 118.0.2, 17.0

Additional information
#628 for a non-breaking attempt at adding the ARIA attributes that do not rely on ID reference by introducing a naming convention
#594 for the breaking change making label and pressed no longer work.

Research and other workarounds are needed to include the attributes that do rely on ID references.

Resources

@sirrah-tam sirrah-tam added the bug label Oct 25, 2023
@daneah daneah changed the title Pharos Button and use of ARIA Button and use of ARIA Nov 2, 2023
@sirrah-tam
Copy link
Contributor Author

closed with #594

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

No branches or pull requests

2 participants