Regression in Popup:normalizeOffset()
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
While migrating from Mapbox v1 to v3 I stumbled over this regression that throws a reference error in the following line:
The regression was introduced in https://github.com/mapbox/mapbox-gl-js/commit/69a888cf303c6b683a7c920eac64e6d4862b9871 by removing this line and setting the default directly in the function parameter:
if (!offset) offset = (new Point(0, 0));
When calling the function with offset = null it throws, where it used to gracefully return the default offset.
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 in src/ui/popup.ts at Popup:normalizeOffset(), especially the line linked in the issue, and review the migration commit that changed the default handling. Verify the null-offset case and confirm that it returns the default Point(0, 0) without a reference error. Add or update the relevant regression test if the surrounding test location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100