Skip to content

Commit

Permalink
fix(react-chart): fix strange text artifacts during scrolling (#2081)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krijovnick committed Jun 13, 2019
1 parent fc6b013 commit e4f7fb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/dx-react-chart/src/plugins/zoom-pan.tsx
Expand Up @@ -9,6 +9,7 @@ import {
PluginComponents,
withComponents,
Size,
clearSelection,
} from '@devexpress/dx-react-core';
import { DragBox } from '../templates/drag-box';
import {
Expand Down Expand Up @@ -131,6 +132,7 @@ class ZoomAndPanBase extends React.PureComponent<ZoomAndPanProps, ZoomAndPanStat

handleMove(scales: ScalesCache, e: any, pane: Size) {
e.preventDefault();
clearSelection();
if (isMultiTouch(e)) {
const current = getDeltaForTouches(e.touches);
this.zoom(scales, current.delta - this.multiTouchDelta!, current.center);
Expand Down
6 changes: 2 additions & 4 deletions packages/dx-react-core/src/draggable/mouse-strategy.ts
@@ -1,6 +1,7 @@
/* globals window:true document:true */

import { toggleGestureCover } from './gesture-cover';
import { clear } from './selection-utils';

const BOUNDARY = 10;
const clamp = (value, min, max) => Math.max(Math.min(value, max), min);
Expand Down Expand Up @@ -38,10 +39,7 @@ export class MouseStrategy {
if (!this.dragging && this.mouseInitialOffset) {
if (isBoundExceeded(this.mouseInitialOffset, { x, y })) {
this.delegate.onStart(this.mouseInitialOffset);
const selection = window.getSelection && window.getSelection();
if (selection && selection.removeAllRanges) {
selection.removeAllRanges();
}
clear();
dragStarted = true;
this.dragging = true;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/dx-react-core/src/index.ts
Expand Up @@ -9,6 +9,9 @@ export { TemplateConnector } from './plugin-based/template-connector';
/** @internal */
export { Draggable } from './draggable';

/** @internal */
export { clear as clearSelection } from './draggable/selection-utils';

/** @internal */
export { DragDropProvider } from './drag-drop/provider';
/** @internal */
Expand Down

0 comments on commit e4f7fb2

Please sign in to comment.