Skip to content

Conversation

@Aryan3902
Copy link
Contributor

@Aryan3902 Aryan3902 commented Jan 9, 2026

Fix #8365

The Issue

The focus guard elements (the hidden spans used to trap focus) were rendered with conflicting attributes: tabIndex="0" combined with aria-hidden="true" and role="presentation".

Reason

A focusable element (tabIndex="0") cannot be marked as hidden (aria-hidden="true") because it creates a state where focus lands on an element that technically "doesn't exist" in the accessibility tree.

The Fix

I have removed aria-hidden={true} and role={'presentation'} from the createFocusableElement helper.

These elements are technically focusable, so they must be exposed to the accessibility tree.

They remain visually hidden via the existing p-hidden-accessible CSS class.

The onFocus event handlers continue to function correctly, redirecting focus instantly without negatively impacting screen reader announcements.

image

How Has This Been Tested?

Automated Scan: Verified that the aria_hidden_nontabbable (Fail_1) error no longer appears in accessibility scans.

Functional Test: Verified that the focus trap still functions correctly (Focus loops back to the start when tabbing past the last element, and vice versa).

Visual Test: Confirmed no visual regression (the spans remain invisible).

@melloware
Copy link
Member

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 9, 2026
@melloware
Copy link
Member

Assigned to @tugcekucukoglu to review since PrimeVue is doing the same thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Pending Review Issue or pull request is being reviewed by Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog : Accessibility - Element "span" should not be focusable within the subtree of an element with an 'aria-hidden' attribute with value 'true'

3 participants