Skip to content

useOverlayTrigger is missing aria-haspopup on most triggerProps #9542

@quisido

Description

@quisido

Provide a general summary of the issue here

When using { type: 'dialog' } or grid or tree, the resulting triggerProps does not contain aria-haspopup="ROLE_HERE".

The aria-haspopup attribute only seems to be set when using menu or listbox.

🤔 Expected Behavior?

The aria-haspopup attribute on triggerProps should match the provided type.

😯 Current Behavior

The aria-haspopup attribute is missing for most types.

💁 Possible Solution

Add the aria-haspopup attribute for the remaining types.

🔦 Context

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-haspopup#dialog

🖥️ Steps to Reproduce

Relevant code snippet:

let ariaHasPopup: undefined | boolean | 'listbox' = undefined;

We only set it as menu because screen readers announce it as menu anyway.

This doesn't feel forward-supportive for screen readers that do add support for these other values. 🤔 Is there harm to setting it to dialog and having the screen reader announce menu anyway? At least it would add support for screen readers that do support dialog.

Version

N/A

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

MacOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions