Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-chart): fix strange text artifacts during scrolling #2081

Merged
merged 2 commits into from Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,
clear,
} 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();
clear();
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 } from './draggable/selection-utils';
Krijovnick marked this conversation as resolved.
Show resolved Hide resolved

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