Skip to content

Commit

Permalink
[demo] add touch events to drag-i
Browse files Browse the repository at this point in the history
  • Loading branch information
hshoff committed Jan 17, 2018
1 parent 4898f01 commit 5941a92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/vx-demo/components/tiles/drag-i.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import { localPoint } from '@vx/event';
import { scaleOrdinal } from '@vx/scale';
import { withParentSize } from '@vx/responsive';
import { LinearGradient } from '@vx/gradient';
import { Drag, raise } from '@vx/drag';

Expand Down Expand Up @@ -52,6 +50,10 @@ export default class DragI extends React.Component {
});
}

componentDidMount() {
this.forceUpdate();
}

render() {
const { width, height } = this.props;
return (
Expand Down Expand Up @@ -108,6 +110,9 @@ export default class DragI extends React.Component {
onMouseMove={dragMove}
onMouseUp={dragEnd}
onMouseDown={dragStart}
onTouchStart={dragStart}
onTouchMove={dragMove}
onTouchEnd={dragEnd}
/>
);
}}
Expand Down
2 changes: 0 additions & 2 deletions packages/vx-demo/pages/drag-i.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export default () => {
return (
<Show component={DragI} title="Drag I">
{`import React from 'react';
import { localPoint } from '@vx/event';
import { scaleOrdinal } from '@vx/scale';
import { withParentSize } from '@vx/responsive';
import { LinearGradient } from '@vx/gradient';
import { Drag, raise } from '@vx/drag';
Expand Down

0 comments on commit 5941a92

Please sign in to comment.