Fix two-finger pan while drawing & Added panel resizing surface on mobile devices.#1019
Merged
Conversation
When drawing a line or polygon, touch events were intercepted unconditionally — including two-finger pan/zoom gestures — preventing Mapbox GL from handling native map navigation while a shape was in progress. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
e3cb26c to
dce2592
Compare
chriswhong
approved these changes
Jun 26, 2026
chriswhong
left a comment
Contributor
There was a problem hiding this comment.
LGTM, actually tested this with an iPad and Apple pencil and an iPhone, everything works as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Two-finger pan while drawing (Reported in #974)
touchstartunconditionally callede.preventDefault()andtouchendunconditionally calledhandlers.click(), regardless of how many fingers were involvedisMultiTouchref in bothuseLineHandlersandusePolygonHandlers— when two or more fingers are detected, touch events are passed through to Mapbox GL rather than treated as drawing actionsHow it works
touchstart: iftouches.length > 1, setisMultiTouch = trueand return without callingpreventDefault()— the map handles the gesture nativelytouchmove: bail out if multi-touch, so no phantom point updates during a pantouchend: skipclickifisMultiTouchis set; reset the flag only once all fingers have lifted (handles the case where two fingers lift one at a time)Closes #974
Fix Mobile Panel Resizability
Closes #986
Remove LegendContainer & Small Design artifact.
Test plan
forcecheck in polygon handler is preserved)🤖 Generated with Claude Code