microsoft / microsoft/tabster

Deloser: support rendered but not visible modals

Open
#188 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Deloser
Dominant language
TypeScript
Stars
165
Forks
42
Avg merge
1d 11h
Merged PRs (30d)
9

Description

Current behavior

At the moment, deloser attributes assume a modal is opened when it's added to the DOM and is closed when it's removed from the DOM, returning the focus to the previous deloser once the modal is closed.

This is not ideal for native modals such as <dialog> since the element is always present at the DOM and it's visibility is dictated by display: none

reproduction

Requested change

Allow deloser to identify the element is not focusable anymore in the DOM although it's still present, therefore allowing return of the focus to the previous deloser.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and trace how deloser attributes detect modal presence and restore focus. Check how a native

or an element hidden with display: none is treated, then verify that focusability changes are recognized while the element remains in the DOM and that focus returns to the previous deloser.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Feature
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.