Deloser: support rendered but not visible modals
Nobody has claimed this yet.
- 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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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