Skip to content

Bug - Dropdown - aria-hidden still set on dropdowns after click #11847

@xbhouse

Description

@xbhouse

Describe the problem
Dropdown menus within modals are aria-hidden even after selecting a dropdown, which prevents users from using keyboards or assistive tech to navigate and messes with automated tests targeting these dropdown elements.

How do you reproduce the problem?
Can be seen in this file in this PR to migrate from PF5 to PF6, and this console error seen in the PF docs for "modal with dropdown" (same error we are seeing in our app's component):

modal/#with-dropdown:1 Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: <button.pf-v6-c-button pf-m-primary>
Ancestor with aria-hidden: <div#root> <div id=​"root" aria-hidden=​"true">​…​</div>​

Expected behavior
We should be able to navigate through and select items in a dropdown with a keyboard / assistive technologies and our tests should be able to target dropdown elements using getByRole. aria-hidden should not be true on the dropdown menu if the menu is open.

Is this issue blocking you?
Non-blocking as we are using a workaround proposed until this is resolved.

What is your environment?

  • OS: Fedora 42
  • Browser: Chrome
  • Version: PF6, React18

What is your product and what release date are you targeting?
This is the Repositories service within Insights. We have a workaround to keep us from being blocked on our PF6 migration.

Any other information?
Current workaround proposed to append the dropdown inline to the modal works for us until this is resolved:

<Modal>
  <Dropdown
   ...
   popperProps={{ appendTo: 'inline' }}
  >
  </Dropdown>
</Modal>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions