aria-haspopup and screen readers

posted on

I read Steve Faulkners “hasPopup hasPoop” where he mentions differences in what screen readers announce when dealing with the aria-haspopup attribute. I wanted to know how that manifests used on a button.

Summary

The situation isn't too bad because all screen readers and browsers, except Narrator in Firefox and Chrome, at least support the attribute. Talback and NVDA don't support the grid, listbox, and tree values. NVDA also doesn't support dialog. Other than that, it works great.

I noticed some interesting details:

Software/OS/browser

I tested using the Tab key only and I've used this CodePen.

form role

form role test results
VoiceOver (iOs) Talkback Voice Over Safari (macOS) Voice Over Firefox (macOS) Voice Over Chrome (macOS) Jaws NVDA (Firefox) NVDA (Chrome, Edge) Narrator (Edge) Narrator (Firefox) Narrator (Chrome)
aria-haspopup="true" Settings, pop-up button, menu pop-up Settings, menu pop-up button Settings, menu pop-up, button Settings, menu button, group Settings, menu pop-up, button Settings, button, menu Settings, menu button, subMenu Settings, menu button, subMenu Settings, button, collapsed, has pop-up Settings, menu item Settings, menu item
aria-haspopup="menu" Settings, pop-up button, menu pop-up Settings, menu pop-up button Settings, menu pop-up, button Settings, menu pop-up, button Settings, menu pop-up, button Settings, button, menu Settings, button, subMenu Settings, menu button, subMenu Settings, button, collapsed, has pop-up Settings, button Settings, menu item
aria-haspopup="menu"
+ aria-expanded="false"
Settings, pop-up button, menu pop-up Collapsed, Settings, menu pop-up button Settings, menu pop-up, button Settings, menu pop-up collapsed, button Settings, menu pop-up collapsed, button Settings, button, menu Settings, button collapsed, subMenu Settings, menu button collapsed, subMenu Settings, button, collapsed, has pop-up Settings, button, collapsed Settings, menu item, collapsed
aria-haspopup="dialog" Settings, pop-up button, dialogue pop-up Settings, dialogue pop-up button Settings, dialogue pop-up, button Settings, dialogue pop-up, button Settings, dialogue pop-up, button Settings, button has pop-up dialogue Settings, button, opens dialog Settings, button, opens dialog Settings, button, has pop-up Settings, button Settings, button
aria-haspopup="grid" Settings, pop-up button, grid pop-up Settings, pop-up button Settings, grid pop-up, button Settings, grid pop-up, button Settings, grid pop-up, button Settings, button has pop-up grid Settings, button, opens grid Settings, menu button, opens grid Settings, button, has pop-up Settings, button Settings, menu item
aria-haspopup="listbox" Settings, pop-up button, list box pop-up Settings, pop-up button Settings, list box pop-up, button Settings, list box pop-up, button Settings, list box pop-up, button Settings, button has pop-up list box Settings, button, opens list Settings, menu button, opens list Settings, button, has pop-up Settings, button Settings, menu item
aria-haspopup="tree" Settings, pop-up button, tree pop-up Settings, pop-up button Settings, tree pop-up, button Settings, tree pop-up, button Settings, tree pop-up, button Settings, button has pop-up tree Settings, button, opens tree Settings, menu button, opens tree Settings, button, has pop-up Settings, button Settings, menu item

aria-haspopup="true"

<button class="toggle" aria-haspopup="true">
    Settings
</button>

aria-haspopup="menu"

<button class="toggle" aria-haspopup="menu">
    Settings
</button>

aria-haspopup="menu" + aria-expanded="false"

<button class="toggle" aria-haspopup="menu" aria-expanded="false">
    Settings
</button>

aria-haspopup="dialog"

<button class="toggle" aria-haspopup="dialog">
    Settings
</button>

aria-haspopup="grid"

<button class="toggle" aria-haspopup="grid">
    Settings
</button>

aria-haspopup="listbox"

<button class="toggle" aria-haspopup="listbox">
    Settings
</button>

aria-haspopup="tree"

<button class="toggle" aria-haspopup="tree">
    Settings
</button>

Update 4.9.2023

NVDA supports the dialog, grid, list, and tree keywords starting with NVDA 2023.2. In prior versions it only announced Settings, button, subMenu.