Skip to content

Move focus into a message when a screen reader does its primary action - #6020

Merged
Eugene (OEvgeny) merged 5 commits into
mainfrom
OEvgeny/fix-transcript-primary-action
Nov 5, 2026
Merged

Eugene (OEvgeny) merged 5 commits into
mainfrom
OEvgeny/fix-transcript-primary-action

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4020. Continues #5867 by ahonamatata.

Changelog Entry

Fixed

Description

#4041 fixed #4020, but the transcript rewrite in #4108 dropped its click handler before either shipped (both in 4.15.0). So no release handles a screen reader's "do primary action" on a message: in Narrator scan mode or NVDA browse mode, "Click to interact." does not move into a card (also #4311). The focused message now handles that click, as #4041 did, and moves focus inside the message or group.

Design

  • A click handler on the active descendant (and the group's): the screen reader consumes ENTER in scan/browse mode, so the transcript's ENTER handler never runs. Not role="application" (Screen reader: support "do primary action" #4041's comment): it turns off browse mode for the whole transcript.
  • Checked with UI Automation in Edge: the focused message now exposes Invoke, which focuses the card's text box. Checked with Narrator: in scan mode, ENTER moves into the message and ESC moves back out. Not yet checked with NVDA.

Specific Changes

  • ActivityRow, PartGroupingActivity: on click, focus the focus trap's target, as ENTER does

  • FocusTrap: targetRef prop for that target

  • focusAttachment.screenReaderPrimaryAction.windowsNarrator.html: card active → text box focused → back after ESCAPE

  • focusAttachment.screenReaderPrimaryAction.nvda.html: same, clicking inside the active descendant

  • part-grouping/primaryAction.windowsNarrator.html: same for a group and its "Show less" button

  • I have added tests and executed them locally

  • I have added .changelog/<PR#>-<slug>.md

  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

ahonamatata and others added 4 commits November 5, 2026 11:01
Copilot-Session: 77b2ba5a-efa7-4a5e-8a90-963dcdef81be

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…hots

- Narrator (click on the active descendant) and NVDA (click inside it) get
  their own files, as #4041 had; the card is emulated, no live bot.
- Snapshot after each focus change, with focusManagement.css painting the
  focused element.
- Drop the plain ENTER steps: focusActivity.focusCard.html,
  focusAttachment.enterKey.html and part-grouping/keyboard.html cover them.
- waitFor + expect instead of pageConditions.became.

Co-authored-by: Ahona Salsabil <asalsabil@microsoft.com>
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review November 5, 2026 21:09
Copilot AI balanced review requested due to automatic review settings November 5, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Accessibility] Scan mode disable ENTER key for "Press ENTER to interact"

4 participants