react-sketch icon indicating copy to clipboard operation
react-sketch copied to clipboard

Drawing with Touchscreen in Chrome

Open jstevenson opened this issue 6 years ago • 3 comments

Is there any plan to get drawing with a touchscreen working for react-sketch? We have some users with Lenovo touchscreen laptops and pens (running Windows) that could benefit greatly from this feature. In Chrome I can occassionally get a dot when using a pen to write at http://tbolis.github.io/showcase/react-sketch/, but it isn't consistent enough to draw.

Thanks for this tool!

--Jim

jstevenson avatar Sep 10 '19 17:09 jstevenson

Did you find a solution to this problem?

nql5161 avatar Nov 06 '19 16:11 nql5161

Hi everyone. Please, let me know if it possible to solve this problem. I really need it. Or any ideas to solve this

VadimRijiiBGU avatar Aug 06 '20 10:08 VadimRijiiBGU

A quick and dirty solution I found is adding these three lines in the componentDidMount of SketchField. On NPM Release 0.5.1 you need to add them at line 589, but it should be fairly obvious on where to place them. Be warned this might cause some unintended sideeffects, but it works fine for my purposes.

canvas.on("touch:start", this._onMouseDown);
canvas.on("touch:move", this._onMouseMove);
canvas.on("touch:end", this._onMouseUp);

lkoehl avatar Jan 13 '21 18:01 lkoehl