This is for a react "customer signature" component. The touchmove event is not firing on Google Chrome browser for Android. I am on a Samsung Galax Tablet a (2016). I have the tablet connected to my PC via USB for console.
In my componentDidMount I get the canvas reference, 2d context, etc and set the event listener for the canvas element:
componentDidMount(){
let canvas = this.refs.canvas;
let ctx = canvas.getContext("2d");
// ...
canvas.addEventListener('touchmove ', (e) => { console.log("touchMove: ", e); });
}
In my render I have the canvas: render(){ }
The event never fires. I have set e.preventDefault on touchstart; the page does not scroll when touching inside the canvas area. Touching inside the canvas and moving your finger doesn't do anything.
I have other events that work so I don't think it's anything related to the canvas reference.
document.addEventListener('keydown', this.keyPress);
canvas.addEventListener('mousemove', this.mouseMove); // works
canvas.addEventListener('touchmove ', (e) => { console.log("touchMove E: ", e); }); // does not work
canvas.addEventListener("mousedown", this.mouseDown); // works
canvas.addEventListener("mouseup", this.mouseUp); // works
canvas.addEventListener("touchstart", this.touchStart); // works
canvas.addEventListener("touchend", this.touchEnd); // works
System Details
Chrome 66.0.3359.158
Android 5.1.1;SM-T280 Build/LMY47V
Let me know if you need other information.
I have the mouseMove working well, so this signature module works perfectly on PC. Now I'm just trying to make this work on mobile/touch screen.
PS I've read and read and read about touchmove issues on android and such, but none of these issues seem to address the same issue I am having.
Thanks for your help