Skip to content

Rich text editor: fix focus trapping and focus on modal close #5720

@marcellamaki

Description

@marcellamaki

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Observed behavior

While most of the focus trapping within the RTE experience and surrounding page is working well, there are at least a few places where the focus is lost or redirected in a confusing way, whether for the screen reader user or the keyboard navigation user.

Errors and logs

On creation of a new question, the subsequent visible focus after TAB is to the "finish button". It is extremely time consuming to get back into the text editor, and extra confusing for the screen reader user who cannot visually orient

Screen.Recording.2026-02-26.at.11.04.48.AM.mov
Screen.Recording.2026-02-26.at.11.25.59.AM.mov

Not refocused after modal close

Screen.Recording.2026-02-26.at.11.28.26.AM.mov

Expected behavior

  • When the user selects the "new question" button, they should be directed to the text editor itself, with a visual focus outline for keyboard navigation
  • When the user closes one of the pop up modal (for example, inserting an image), they should be redirected to the image inserted in the text editor, not popped out to the main window

User-facing consequences

Frustrating experience for keyboard nav users. Screen reader users will get totally lost

Context

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions