Commit f37f9ec 1 parent 7c4f81f commit f37f9ec Copy full SHA for f37f9ec
File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,11 @@ export default class ChartAdapterStore {
43
43
touchValues : {
44
44
deltaXTotal ?: number ;
45
45
deltaYTotal ?: number ;
46
+ multiTouch ?: boolean ;
46
47
x ?: number ;
47
48
y ?: number ;
48
49
} = {
50
+ multiTouch : false ,
49
51
deltaXTotal : 0 ,
50
52
deltaYTotal : 0 ,
51
53
x : 0 ,
@@ -245,12 +247,16 @@ export default class ChartAdapterStore {
245
247
onTouch ( e : TouchEvent ) {
246
248
// Prevent vertical scroll on the chart for touch devices by forcing scroll on a scrollable parent of the chart:
247
249
const chartNode = this . mainStore . chart . chartNode ;
248
- if (
249
- chartNode &&
250
- this . scrollableChartParent &&
251
- ! this . mainStore . state . isVerticalScrollEnabled &&
252
- e . changedTouches . length === 1
253
- ) {
250
+ if ( chartNode && this . scrollableChartParent && ! this . mainStore . state . isVerticalScrollEnabled ) {
251
+ if ( this . touchValues . multiTouch ) {
252
+ if ( e . type === 'touchend' ) this . touchValues . multiTouch = false ;
253
+ return ;
254
+ }
255
+ if ( e . touches . length > 1 ) {
256
+ this . touchValues . multiTouch = true ;
257
+ return ;
258
+ }
259
+
254
260
const { pageX, pageY } = e . changedTouches [ 0 ] ;
255
261
256
262
if ( [ 'touchmove' , 'touchend' ] . includes ( e . type ) ) {
You can’t perform that action at this time.
0 commit comments