Keyboard handler method `isActive` returns `false` when expecting `true`, keyup/keydown event listeners do not fire
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: latest main
browser: any, tested on macbook pro
While key gestures work as expected, keyup and keydown events do not fire for map event listeners. In addition, if you set up a listener for zoom and use the key driven event (e.g. +/-), map.keyboard.isActive() returns false when is it is expected to return true.
There are no unit tests for either of these Keyboard handler events.
Expected Behavior
keyup and keydown event listeners work when pressing keys on the map. map.keyboard.isActive() returns true when using a keyboard event.
Actual Behavior
keyup and keydown don't fire, map.keyboard.isActive() returns false
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 at the Keyboard handler and the map.keyboard.isActive() entry point; trace how keyup and keydown listeners are handled during keyboard-driven zoom. Add focused unit tests for both event types and the active-state behavior. Done means both listeners fire on map key presses and isActive() returns true during keyboard input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100