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

Tabs: Tabs are not operable by keyboard #5151

Closed
marcoscv-work opened this issue Oct 20, 2022 · 7 comments · Fixed by #5154
Closed

Tabs: Tabs are not operable by keyboard #5151

marcoscv-work opened this issue Oct 20, 2022 · 7 comments · Fixed by #5154
Assignees
Labels
comp: accessibility Issues related to accessibility in general type: bug Issues reporting that Component is not doing what should be done

Comments

@marcoscv-work
Copy link
Member

We cannot move along tabs by keyboard using tab or arrows.

image

https://clayui.com/docs/components/tabs.html#content

Why do we need this functionality?
WCAG 2.1 - Operable: 2.1 Keyboard Accessible

We should be able to get all tabs by keyboard, there are different ways to get it, most popular is the combination of tab and arrow keys, examples:

If possible, a API property to select if the activation is automatic or manual would be awesome, if not, manual activation is a more common case for liferay

@marcoscv-work marcoscv-work added type: bug Issues reporting that Component is not doing what should be done comp: accessibility Issues related to accessibility in general labels Oct 20, 2022
@matuzalemsteles
Copy link
Member

Hey @marcoscv-work I ended up changing it these days but I still haven't put the navigation by arrow, I think the navigation here between the tabs should only be via the arrow keys and not using tab, do you think we should do that yet? I didn't find anything in the documentation about this, the tab behavior looks like it is, move to the active tab and the next element to the active tabpanel.

About tab activation, it makes sense to have an API to configure this and we can add a recommendation of when to use this, apparently the good thing about manual activation is only when the panel is loaded on demand.

@marcoscv-work
Copy link
Member Author

Hello @matuzalemsteles thanks for responding so quickly
I think using arrows would be perfect, in that case and with correct aria labeling we wouldn't need tab key

@matuzalemsteles
Copy link
Member

Just noting a few things here, in order to be able to change the active state of the tab when navigating through the tabs, we will need to restructure the component to control the active state, today the implementation of tabs who controls the active state is the developer when will implement.

To make this more OOTB, I'm going to add the RFC 0002 Controlled and uncontrolled components pattern to control the asset state so we can change the asset state and have visibility into it. Other things that would also be useful like automatically adding aria-controls and creating the id of the tabs to associate the tab and the panel automatically without being manual, I will leave to work on that in another issue that is related to the Collection pattern #5032 which will allow us to have more OOTB functionality like this.

@marcoscv-work
Copy link
Member Author

Thanks @matuzalemsteles !! it's great! it looks awesome!

Just a warning, it's possible people who working on BofA accessibility bugs contact us related with tabs, there are some issues related: https://issues.liferay.com/browse/LPS-165822

@matuzalemsteles
Copy link
Member

matuzalemsteles commented Oct 22, 2022

No problem, despite making some changes we still have compatibility with the previous version the navigation with the automatic activation that has to follow the pattern but the manual activation works OOTB, but then the automatic navigation should work OOTB without needing to be controlled.

@marcoscv-work
Copy link
Member Author

No problem, despite making some changes we still have compatibility with the previous version the navigation with the automatic activation that has to follow the pattern but the manual activation works OOTB, but then the automatic navigation should work OOTB without needing to be controlled.

That's perfect, automatic activation is something we will use in a close future but the manual one is the standard for portal so perfect!, thanks @matuzalemsteles

@github-actions
Copy link

This issue has been merged and will be released in DXP at https://issues.liferay.com/browse/LPS-165856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: accessibility Issues related to accessibility in general type: bug Issues reporting that Component is not doing what should be done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants