mapbox / mapbox/mapbox-gl-js

More robust `focusQuerySelector` for popup focus

Open
#11,762 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

In:

https://github.com/mapbox/mapbox-gl-js/blob/45dd9cb02930f639330a48c06806c55bde8e3259/src/ui/popup.js#L38-L46

- I believe you'd rather want :not(:disabled) over `:not([disabled])`, because the latter does not select these elements if they're disabled via a parent, e.g. ``.

- Also, `video[controls]` is focusable, at least in Chrome.

In https://github.com/WICG/inert/blob/09c0647f59a3ad61ffbd92d17b9a0770fdbef412/src/inert.js#L24-L35 the following is also present:
- `area[href]`
- `details` (not sure why this is included, I think `summary` is the focusable element in all browsers?)
- `summary`
- `iframe`
- `embed`
- `object`

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

Inspect src/ui/popup.js at the focusQuerySelector lines and compare its selector with the focusable-element cases listed in the issue and WICG inert.js. Done means popup focus handling accounts for disabled descendants and the additional elements identified in the report.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.