Menu

When Automatically Restoring Focus Becomes an Accessibility Bug
πŸ“°

When Automatically Restoring Focus Becomes an Accessibility Bug

DEV Community: vueΒ·Tran Manh DungΒ·7 days ago
#G0RqkURN
#devtovue#devto#dev#focus#option
Long article (1456 words) β€” no AI summary yet.
Reading 0:00
15s threshold

Focus management is one of those frontend problems that looks relatively simple until you start dealing with reactive state, component lifecycles, and application-controlled behavior.

A recent fix in Reka UI provides an interesting example of how restoring focus can introduce another accessibility problem if the component doesn't understand who owns that focus.

This article explores the behavior behind issue #1296 and the corresponding pull request #3423 .

1. The original problem

Imagine a multiple-selection Listbox containing four options:

Apple Banana Cherry Orange

Enter fullscreen mode

Exit fullscreen mode

The application implements custom filtering that removes selected options from the available list.

A keyboard user navigates to Apple and presses Space.

The selection succeeds, and the list becomes:

Banana Cherry Orange

Enter fullscreen mode

Exit fullscreen mode

However, the DOM element representing Apple has been removed.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.