Repository navigation
Drop touch gestures that gain a finger the chart never saw - #238
Merged
Merged
Conversation
dygraphs records the touches of touchstart and, on a two-finger touchmove, reads initialTouches[1]. When the second finger lands outside the chart its touchstart never reaches the canvas, yet later touchmove events list both fingers, so moveTouch read initialTouches[1].pageX of undefined. touchMove now clears the stale gesture and ignores the event when it carries more touches than the gesture started with.
kapantzak
previously approved these changes
Sep 29, 2026
kapantzak
approved these changes
Sep 29, 2026
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.
Problem
Sentry NETDATA-INC-DNA (45 events in 24h, all on cloud-frontend 7.129.0 with charts 6.12.15):
Cannot read properties of undefined (reading 'pageX')in dygraphsmoveTouch(dygraph-interaction-model.js:525,initialTouches[1].pageX).The #237 guard (
generic.js) only checks thatcontext.initialTouchesexists. When the second finger lands outside the chart, itstouchstartnever reaches the canvas, so dygraphs records one touch, while latertouchmoveevents list both fingers. The production stack confirms the guard shipped: the throwing call is the line right afterif (!context.initialTouches) return.Change
touchMoveclears the stale gesture and ignores the event when it carries more touches than the gesture started with. Valid pans and two-finger pinches still delegate to dygraphs.Tests
touchstartthen a two-fingertouchmovewith no secondtouchstart. Before the fix it throws the productionTypeErroratdygraph-interaction-model.js:525:44viageneric.js:124.Release
cloud-frontend needs a charts release with this change and an
@netdata/chartsbump before DNA stops. Browser check still pending: pan, pinch, adding a finger outside the chart, double tap, on iOS Safari and Android Chrome.