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(cv-data-table): accessibility violation - batch action cancel button #1422

Open
wants to merge 3 commits into
base: vue2
Choose a base branch
from

Conversation

peterzaccha
Copy link

@peterzaccha peterzaccha commented Feb 27, 2023

Contributes to #

This PR fixes the accessibility violation
Element "button" should not be focusable within the subtree of an element with an 'aria-hidden' attribute with value 'true'

## What did you do?

inspired by the react carbon lib
i check if the batch actions are not active, set the tabindex on the cancel button to -1

## Why did you do it?

How have you tested it?

Were docs updated if needed?

  • N/A
  • No
  • Yes

Copy link
Collaborator

@davidnixon davidnixon left a comment

Choose a reason for hiding this comment

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

:-( Sorry for being so slow.

  1. I think this is a good fix and thanks for taking the time to work on it.
  2. Looking at the React storybook the tab index is toggled when the batch action is active just as you have done here
  3. However in react all the buttons under the batch action are toggled

Could you tweak this to watch the batchActive data and react to changes by find and toggle all the buttons under batch actions?

I think you will need a ref on the --action-list div and a query like:

toggle(val) {
buttons=this.actionList.querySelectorAll('button')
buttons.forEach((b) => b.tabIndex = val)
}

@davidnixon davidnixon added the Vue2 issue with Vue 2 components label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vue2 issue with Vue 2 components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants