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(Tabs): add aria-label to overflow scroll buttons #7353

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Nov 30, 2020

Closes #7304

This PR sets a default aria-label to the scroll overflow buttons to remove a11y violations. Since the buttons are not in the tab order a visible label is probably not necessary. Added support for additional props on the scroll overflow buttons to allow for different aria-label values

Changelog

New

  • aria-label on scroll overflow buttons

Testing / Reviewing

Confirm that the a11y checker violation on the overflow button labels is no longer raised

@netlify
Copy link

netlify bot commented Nov 30, 2020

✔️ Deploy preview for carbon-elements ready!

🔨 Explore the source changes: c574d09

🔍 Inspect the deploy logs: https://app.netlify.com/sites/carbon-elements/deploys/60070f7c31b9ce000776a930

😎 Browse the preview: https://deploy-preview-7353--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Nov 30, 2020

✔️ Deploy preview for carbon-components-react ready!
Built without sensitive environment variables

🔨 Explore the source changes: c574d09

🔍 Inspect the deploy logs: https://app.netlify.com/sites/carbon-components-react/deploys/60070f7c0d56650007957a7b

😎 Browse the preview: https://deploy-preview-7353--carbon-components-react.netlify.app

@emyarod emyarod requested a review from a team as a code owner November 30, 2020 16:24
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM, no a11y warnings 👍 ✅

/**
* Provide the props that describe the left overflow button
*/
leftOverflowButtonProps: PropTypes.object,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way we could allow folks to configure the labels without giving them a way to pass in any prop to the buttons? Maybe something like overflowStartLabel, overflowEndLabel? or scrollPrevLabel, scrollMoreLabel (just throwing out some ideas)

Exposing that this is a button and allowing folks to configure it might expose some internal implementation details, or prevent us from refactoring like if we wanted the label to be inside of the button instead of aria-label, or would want to connect it using aria-labelledby or something 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I was looking ahead and figuring that people would want to extend the button so I didn't want to make the prop too restrictive by making it label-only

the use of aria-label was suggested by @carmacleod since there is no visible label for these overflow buttons

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're anticipating folks to configure the buttons directly it might be helpful to extract them as components and allow folks to pass props directly to them (and support providing these buttons as children)

Definitely think aria-label is the right call, just was saying that this would restrict changes we make if we ever want to change how these buttons are implemented (e.g. if we wanted to use aria-labelledby for some reason).

An example of this could be the components that forward props to downshift, for example. It makes updating that package difficult as we have to manage the breaking changes in props (like name changes) if we want to update it in a minor release.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just don't know that we need to provide that much configurability for these buttons when the logic that displays them is all internal. is this a future change that you are predicting for this component? it seems like we're solving an issue that isn't occurring given the component spec and a11y requirements

@emyarod emyarod force-pushed the 7304-tab-overflow-button-labels branch 2 times, most recently from 0467b02 to f7e0918 Compare December 10, 2020 17:03
@emyarod emyarod force-pushed the 7304-tab-overflow-button-labels branch from f7e0918 to c933ff7 Compare December 10, 2020 17:57
@gptt916
Copy link
Contributor

gptt916 commented Jan 6, 2021

Will this fix make it into the upcoming release?

@emyarod
Copy link
Member Author

emyarod commented Jan 7, 2021

unfortunately not the initial release, but it is still awaiting reviews so it still may be released in a patch

@kodiakhq kodiakhq bot merged commit 07e3e1d into carbon-design-system:master Jan 19, 2021
@emyarod emyarod deleted the 7304-tab-overflow-button-labels branch January 20, 2021 15:23
@emyarod emyarod mentioned this pull request Jan 22, 2021
46 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs: Form control element <button> has no associated label
4 participants