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

Incorrect tabpanel ID in Tab Component #7431

Closed
1 of 4 tasks
daniel-hitchins opened this issue Mar 12, 2025 · 0 comments · Fixed by #7444
Closed
1 of 4 tasks

Incorrect tabpanel ID in Tab Component #7431

daniel-hitchins opened this issue Mar 12, 2025 · 0 comments · Fixed by #7444
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@daniel-hitchins
Copy link

daniel-hitchins commented Mar 12, 2025

Describe the bug

The tabpanel in the Tab component has an incorrect id. Instead of the expected format (e.g., pv_id_1_36_tabpanel_0), it is being rendered as undefined_tabpanel_0. This causes an accessibility issue because the corresponding tab button has an aria-controls attribute that references the correct ID (aria-controls="pv_id_1_36_tabpanel_0"), resulting in a mismatch.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-fmqqvzwa?file=src%2FApp.vue

Environment

Library/Framework Version: Storybook 8.1.11
Browser: Chrome 134.0.6998.36
Operating System: Windows 11

Vue version

3.4.31

PrimeVue version

4.3.0

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Render the Tab component in the application.
  2. Inspect the generated HTML for the tabpanel and tab button elements.
  3. Notice that the tabpanel has an id="undefined_tabpanel_0" while the tab button has aria-controls="pv_id_1_36_tabpanel_0".

Expected behavior

The tabpanel should have the correct id, matching the expected format so that the aria-controls attribute on the tab button correctly references it.

<!-- Current incorrect output -->
<div id="undefined_tabpanel_0" role="tabpanel"></div>
<button aria-controls="pv_id_1_36_tabpanel_0">Tab 1</button>

<!-- Expected correct output -->
<div id="pv_id_1_36_tabpanel_0" role="tabpanel"></div>
<button aria-controls="pv_id_1_36_tabpanel_0">Tab 1</button>

@daniel-hitchins daniel-hitchins added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 12, 2025
@daniel-hitchins daniel-hitchins changed the title Issue Title Incorrect tabpanel ID in Tab Component Mar 12, 2025
@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 Mar 14, 2025
@tugcekucukoglu tugcekucukoglu added this to the 4.3.3 milestone Mar 14, 2025
@tugcekucukoglu tugcekucukoglu self-assigned this Mar 14, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeVue Mar 14, 2025
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeVue Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants