Closed hassaanalansary closed 4 years ago
@mockdeep I am very bad at naming functions, please review function touchStartProcedure
name. and change it to what you see fit.
Thanks
@hassaanalansary thanks for following up on this!
@hassaanalansary you resolved the conversation above, but it doesn't look like you pushed any code changes. Is there more to be done on this?
No, i believe not. Sorry for the bad follow up. It has been crazy with me. You can accept the pull request and close it if you please. Thanks
No, i believe not. Sorry for the bad follow up. It has been crazy with me. You can accept the pull request and close it if you please. Thanks
@mockdeep can you review the change so it can be merged. I know it has been very long since I start the PR. Better late than never. :)
@hassaanalansary I unresolved one comment. It would be good to still rename the function. @olivertitze are you able to have another look as well?
@olivertitze fixed that
I reviewed and tested this request. This disables the "Draw it" option by adding the line 366: this.removeEventListener('touchstart', startTouchDrawing), and the issue is real. the switching between mouse and touch is not working. when i use touch pad to draw and then want to use the touch screen, it is not working the same at reverse.
@ehsanmohebbi Did you test this on a Desktop or mobile device? and which browser? Are you sure the issue is because of this PR or this one https://github.com/thread-pond/signature-pad/pull/203
@hassaanalansary I tested it on Windows 10 touch screen device using google chrome browser.
@ehsanmohebbi so this fixes the issue for you? When you say "This disables the "Draw it" option" do you mean it is introducing a new bug?
Okay, I'm going to go ahead and merge this. Feel free to open a new issue or PR if things are still broken.
Issue: when you start drawing by mouse and change to drawing by touch , the mouse button stay triggered. causing the undesired drawing on the canvas.
Fix: Remove event listener
touchstart
after adding it.Explanation: After changing from
this.ontouchstart
tothis.addEventListener('touchstart')
. we should replacethis.ontouchstart = null;
bythis.removeEventListener('touchstart', touchStartProcedure)