Skip to content

Change the inserter search results message to polite #13387

@afercia

Description

@afercia

When opening the inserter, the number of initial available results is announced by assistive technologies via a speak() message sent to the assertive ARIA live region.

The assertive message interrupts what's currently being announced by the screen reader and, with some browser / screen reader combinations, this prevents the search field to be announced correctly.

In my testing, Safari + VoiceOver are affected. To reproduce:

  • using the keyboard, tab to the main inserter button
  • press Control Option Spacebar
  • the inserter opens, focus is moved to the search field
  • the search field label "Search for a block" is not announced
  • the number of results is announced almost immediately

screenshot 2019-01-20 at 17 01 53

Changing the message from assertive to polite fixes the issue and in my testing doesn't affect other browser / screen reader combos.

Worth noting this message is debounced by 500 ms and this might explain the different behavior across different combos. Also, screen readers have different ARIA live implementations. Regardless, it makes sense to let screen readers announce the search field first, and then the number of results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Type] EnhancementA suggestion for improvement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions