Automattic / Automattic/simplenote-electron

Opening and dismissing Revision Selector with screen reader/keyboard does not return focus to previously focused element

Open
#2,802 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
5.3k
Forks
588
Avg merge
9h 45m
Merged PRs (30d)
4

Description

The typical approach for managing focus with dialogs is that focus is returned to the previously focused element once the dialog is closed/dismissed. I.e. closing a modal should return focus back to the button used to open the modal. This allows the screen reader/keyboard user to continue from the last focus set.

Currently, the focus is unexpectedly placed on the editor when the Revision Selector is dismissed. This is related to the work in #2531 as mentioned in https://github.com/Automattic/simplenote-electron/pull/2531#pullrequestreview-607705670.

### Expected
The History button regains focus.

### Observed
The note editor gains focus.

### Reproduced
1. Launch Simplenote.
2. Enable screen reader and move focus to History button -OR- click outside of the editor (to remove focus from editor) and press Tab until the History button is focused.
3. Press Return to click the History button.
4. Press Esc to dismiss the Revision Selector.

https://user-images.githubusercontent.com/438664/112163272-df367c80-8bba-11eb-8aeb-6c13b1fbb656.mov

### Where did you see the bug

- System Make: Apple
- System Model: MacBook Pro
- OS: macOS
- OS version: 11.2.3
- Browser (if applicable): Safari
- Browser version (if applicable): 14.0.3
- Simplenote app version: 2.9.0-beta1

Contributor guide

Open the contributing guide

Research direction

Reproduce the Revision Selector flow with a screen reader or keyboard, then inspect the focus handling related to issue #2531. Confirm that dismissing the selector with Esc returns focus to the History button rather than the note editor; the issue does not name a specific file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.