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

TabMenu: Accessibility issue in TabMenu with hidden tabs #3910

Closed
hstupkova opened this issue Apr 28, 2023 · 0 comments
Closed

TabMenu: Accessibility issue in TabMenu with hidden tabs #3910

hstupkova opened this issue Apr 28, 2023 · 0 comments
Assignees
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@hstupkova
Copy link

Describe the bug

You can't navigate between tabs with keyboard right and left arrow keys if there are tabs that have visible: false.

The problem is that findNextItem method receives an array of tabs that does not include hidden tabs (this.$refs.tab), but the index of the current tab is taken from an array of all tabs including the hidden ones (@keydown receives i from model).

<template v-for="(item, i) of model" :key="label(item) + '_' + i.toString()">
                <router-link v-if="item.to && !disabled(item)" v-slot="{ navigate, href, isActive, isExactActive }" :to="item.to" custom>
                    <li v-if="visible(item)" ref="tab" :class="getRouteItemClass(item, isActive, isExactActive)" :style="item.style" role="presentation" v-bind="ptm('menuitem')">
                        <template v-if="!$slots.item">
                            <a
                                ref="tabLink"
                                v-ripple
                                role="menuitem"
                                :href="href"
                                class="p-menuitem-link"
                                :aria-label="label(item)"
                                :aria-disabled="disabled(item)"
                                :tabindex="isExactActive ? '0' : '-1'"
                                @click="onItemClick($event, item, i, navigate)"
                                @keydown="onKeydownItem($event, item, i, navigate)"
                                v-bind="ptm('action')"
                            >

Reproducer

https://codesandbox.io/s/goofy-bell-vjc077

PrimeVue version

3.27.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

Tabs should be accessible with keyboard even if there are hidden tabs in the model.

@hstupkova hstupkova added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 28, 2023
@hstupkova hstupkova changed the title TabMenu: Accessibility issue for TabMenu with hidden tabs TabMenu: Accessibility issue in TabMenu with hidden tabs Apr 28, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 12, 2023
@tugcekucukoglu tugcekucukoglu added this to the 3.29.1 milestone May 12, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this May 12, 2023
@tugcekucukoglu tugcekucukoglu added the Component: Accessibility Issue or pull request is related to WCAG or ARIA label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants