Fix touch gesture conflicts in WebGL example apps on mobile#554
Open
mel-anthropic wants to merge 2 commits intomodelcontextprotocol:mainfrom
Open
Fix touch gesture conflicts in WebGL example apps on mobile#554mel-anthropic wants to merge 2 commits intomodelcontextprotocol:mainfrom
mel-anthropic wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
@modelcontextprotocol/ext-apps
@modelcontextprotocol/server-basic-preact
@modelcontextprotocol/server-basic-react
@modelcontextprotocol/server-basic-solid
@modelcontextprotocol/server-basic-svelte
@modelcontextprotocol/server-basic-vanillajs
@modelcontextprotocol/server-basic-vue
@modelcontextprotocol/server-budget-allocator
@modelcontextprotocol/server-cohort-heatmap
@modelcontextprotocol/server-customer-segmentation
@modelcontextprotocol/server-debug
@modelcontextprotocol/server-map
@modelcontextprotocol/server-pdf
@modelcontextprotocol/server-scenario-modeler
@modelcontextprotocol/server-shadertoy
@modelcontextprotocol/server-sheet-music
@modelcontextprotocol/server-system-monitor
@modelcontextprotocol/server-threejs
@modelcontextprotocol/server-transcript
@modelcontextprotocol/server-video-resource
@modelcontextprotocol/server-wiki-explorer
commit: |
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.
On touch devices, drag/pan gestures inside the WebGL-based example apps (Maps, ThreeJS, Wiki Explorer) were propagating to the parent scroll view, causing the page to scroll while trying to interact with the 3D content.
Root cause: The rendering libraries these apps use (CesiumJS, Three.js OrbitControls, force-graph) handle drag interaction via pointer events. On touch devices, the browser doesn't know that these pointer event handlers are "consuming" the touch — it still interprets the gesture as a scroll and forwards it to the parent scroll view. The browser only backs off when it sees explicit touch event handlers that signal "I'm handling this touch, don't scroll."
Fix: Add
touchstart/touchmoveevent handlers on the interactive canvas elements that callpreventDefault()to signal to the browser that the touch is being handled by the app. Shadertoy already had correct touch handlers, so only a CSS hint was added there.