mapbox / mapbox/mapbox-gl-js

_fullscreenchange property not gracefully handled on iOS Safari

Open
#11,433 1 comment 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

**mapbox-gl-js version**: latest

**browser**: iOS safari (mobile)

**description of problem**

iOS Safari lacks a 'onwebkitfullscreenchange' event on iPhones

https://developer.mozilla.org/en-US/docs/Web/API/Element/onfullscreenchange

https://github.com/mapbox/mapbox-gl-js/blame/main/src/ui/control/fullscreen_control.js#L48

This means that _fullscreenchange is never set.

This results in onRemove calling removeEventListener with ```undefined``` as the first property, causing issues with our logging library, which never expects ```undefined``` to be the first argument (we will be submitting an issue to fix that too and patching it in the meantime).

https://github.com/mapbox/mapbox-gl-js/blame/main/src/ui/control/fullscreen_control.js#L68

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 in src/ui/control/fullscreen_control.js at the referenced lines around 48 and 68. Inspect how _fullscreenchange is assigned and how onRemove uses it when iOS Safari lacks the event. Done means removing the control no longer passes an undefined event name to removeEventListener on that browser.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.