-
Thanks for the amazing library. I'm using the Vanilla version, and I was wondering if is possible to initiate a class App extends Component {
constructor(props) {
super(props)
this.canvasRef = React.createRef();
}
componentDidMount() {
const { canvasRef: { current: canvas } } = this;
new DragGesture(canvas, (state) => console.log(state));
}
render() {
return (
<div className="app">
<canvas ref={this.canvasRef} />
</div>
)
}
} A workaround might be to use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, indeed the drag gesture won't start if the primary button isn't pressed, and similarly However I wouldn't recommend using the middle button as a trigger since most trackpads don't have it. |
Beta Was this translation helpful? Give feedback.
Hi, indeed the drag gesture won't start if the primary button isn't pressed, and similarly
pressed
is only true when the primary button is pressed. There could be an option where you would specify which button would trigger the drag https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons.However I wouldn't recommend using the middle button as a trigger since most trackpads don't have it.