Skip to content

Screen readers don't announce SuggestBox suggestions (e.g. Install Packages) #19254

Closed

Description

@gtritchie

Screen readers don't announce the suggestions in GWT SuggestBox popups. In the Install Packages dialog, typing a partial package name shows a list of matching packages, but a screen reader doesn't announce them, in Safari or Chrome.

The suggestions are menuitems in a popup attached to <body>, and nothing links them to the text box. Focus stays in the <input> throughout, and the input has no combobox role, aria-expanded, aria-controls, or aria-activedescendant, so assistive technology isn't told that a list is open or which item is highlighted. SuggestBox in the GWT fork sets no ARIA attributes at all.

The usual fix is the combobox pattern: role="combobox", aria-expanded, aria-controls, and aria-activedescendant on the input, with role="listbox" and role="option" in the popup. This could go in the fork's SuggestBox/DefaultSuggestionDisplay, which would cover every caller, or in RStudio's wrappers.

Seen in Install Packages (InstallPackageDialog.java#L176). These other places use SuggestBox with an oracle that returns suggestions, and likely behave the same (not checked):

  • Help pane search (HelpSearchWidget, via SearchWidget (SearchWidget.java#L178))
  • Go to File/Function (CodeSearchWidget, via SearchWidget)
  • Search tabs in the source tab overflow menu (TabOverflowPopupPanel)
  • Go to column in the data viewer (DataTable)
  • Code block language in the visual editor (PanmirrorLangSuggestBox)
  • Adding a user in Project Sharing in Posit Workbench (AutocompleteComboBox, used by ProjectSharing in rstudio-pro)

Most other SearchWidget uses are filter boxes whose oracles return no suggestions, so no popup appears.

This isn't caused by the aria-modal change for #19251; it also happens in builds without it.

Activity

  1. self-assigned this
    on Oct 23, 2026
  2. added theissue type on Oct 23, 2026
  3. gtritchie commented on Oct 29, 2026

    @gtritchie
    MemberAuthor

    Where the fix should go: the GWT fork, with only small follow-up work in RStudio.

    Why the fork:

    • Every caller listed above uses SuggestBox.DefaultSuggestionDisplay or a subclass (SearchWidget's SearchSuggestionDisplay, AutocompleteSuggestionDisplay, PanmirrorLangSuggestBox; InstallPackageDialog uses it directly). None of the subclasses replace how the popup or its items are built, so a fork fix covers all of them, including AutocompleteComboBox in rstudio-pro.
    • The parts that need to change are private in the fork:
      • Items are built in the private SuggestionMenuItem constructor (where role="option" and an id would be set).
      • The highlighted item changes in the private SuggestionMenu.selectItem(), and mouse hover goes through MenuBar.itemOver. Neither passes through the protected moveSelectionUp/moveSelectionDown, which is all a subclass can hook to keep aria-activedescendant current.
      • MenuBar sets its own menu/menuitem roles, which the fork can change where they're set.

    Why not RStudio alone: it would need a shared DefaultSuggestionDisplay subclass swapped in at every caller, rewriting roles and ids in the popup DOM after super.showSuggestions() and working out the highlighted item from CSS classes. That misses hover, breaks if the fork's DOM changes, and any future caller using a plain SuggestBox stays inaccessible.

    Cost of the fork route: the patch goes on the release branch, gets a new SDK build name and a GWT_VERSION bump (see src/gwt/tools/build-gwt-README.md), and has to be carried forward to later release branches. It may also be worth offering upstream.

    Remaining RStudio work: bump the GWT version, check that each caller's input has an accessible name, and spot-check that SearchSuggestionDisplay's first-mouseover suppression (SearchWidget.java) doesn't conflict with the new selection tracking.

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions