Skip to content

Commit 3b955ba

Browse files
committed
Fix touch move on mobile
1 parent ad5ca44 commit 3b955ba

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/component/dataZoom/SliderZoomView.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ define(function (require) {
99
var linearMap = numberUtil.linearMap;
1010
var layout = require('../../util/layout');
1111
var sliderMove = require('../helper/sliderMove');
12+
var eventTool = require('zrender/core/event');
13+
1214
var asc = numberUtil.asc;
1315
var bind = zrUtil.bind;
1416
// var mathMax = Math.max;
@@ -415,6 +417,10 @@ define(function (require) {
415417
draggable: true,
416418
cursor: 'move',
417419
drift: bind(this._onDragMove, this, 'all'),
420+
onmousemove: function (e) {
421+
// Fot mobile devicem, prevent screen slider on the button.
422+
eventTool.stop(e.event);
423+
},
418424
ondragstart: bind(this._showDataInfo, this, true),
419425
ondragend: bind(this._onDragEnd, this),
420426
onmouseover: bind(this._showDataInfo, this, true),
@@ -452,6 +458,10 @@ define(function (require) {
452458
cursor: this._orient === 'vertical' ? 'ns-resize' : 'ew-resize',
453459
draggable: true,
454460
drift: bind(this._onDragMove, this, handleIndex),
461+
onmousemove: function (e) {
462+
// Fot mobile devicem, prevent screen slider on the button.
463+
eventTool.stop(e.event);
464+
},
455465
ondragend: bind(this._onDragEnd, this),
456466
onmouseover: bind(this._showDataInfo, this, true),
457467
onmouseout: bind(this._showDataInfo, this, false)

src/component/visualMap/ContinuousView.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define(function(require) {
88
var LinearGradient = require('zrender/graphic/LinearGradient');
99
var helper = require('./helper');
1010
var modelUtil = require('../../util/model');
11+
var eventTool = require('zrender/core/event');
1112

1213
var linearMap = numberUtil.linearMap;
1314
var each = zrUtil.each;
@@ -230,6 +231,10 @@ define(function(require) {
230231
var handleLabel = new graphic.Text({
231232
draggable: true,
232233
drift: onDrift,
234+
onmousemove: function (e) {
235+
// Fot mobile devicem, prevent screen slider on the button.
236+
eventTool.stop(e.event);
237+
},
233238
ondragend: onDragEnd,
234239
style: {
235240
x: 0, y: 0, text: '',
@@ -794,6 +799,10 @@ define(function(require) {
794799
draggable: !!onDrift,
795800
cursor: cursor,
796801
drift: onDrift,
802+
onmousemove: function (e) {
803+
// Fot mobile devicem, prevent screen slider on the button.
804+
eventTool.stop(e.event);
805+
},
797806
ondragend: onDragEnd
798807
});
799808
}

0 commit comments

Comments
 (0)