Negative piece count in Editor
Split from https://github.com/gbtami/pychess-variants/issues/723 https://user-images.githubusercontent.com/48226312/156930148-183c8623-6f59-4570-8e42-13d148fe0d01.mp4
This is affecting the ability to add pieces in the editor when using the Apple Pencil. I'm noticing that the editor doesn't seem to recognize the Apple pencil when dragging pieces to the board. But when I use my fingers it recognizes the pieces correctly. I was going to post a github ticket on this very issue right now but saw this and decided to simply put my input here.
@Fulmene @nnickoloff1234 any idea?
Unfortunately don't know how to test and reproduce this without buying that specific hardware. If I had to shoot in the dark I would remove "touchmove" from this array:
https://github.com/gbtami/chessgroundx/blob/fbc577b557e37efcdec76212910c08d1b1e02126/src/types.ts#L227
But not sure what might break. Still I feel it is worth the shot, if someone can coordinate the change in source+deployment+testing, because it is a small change and just by looking at the source it makes sense "touchmove" to be removed and feels like some legacy thing from previous implementation that no longer makes sense.
If above change fixes the problem, but as a side effect somehow breaks something else related to pocket then I would suggest this line to be changed instead:
https://github.com/gbtami/pychess-variants/blob/03e2dbf45d8fd9c9889477aab42185046926595f/client/editorCtrl.ts#L96
To
['mousedown'].forEach(name =>
(of course then can be simplified)
I think I'll need to read up on web event again, but why was the touch event for eventsDragging touchmove instead of touchstart?
i wrote my above comments assuming these touch* events are irrelevant, redundant and useless and tablet stuff would trigger appropriate mouse* events as well, so we don't need that touch stuff at all.
On second thought i am not sure why i would assume that, based on my zero experience with touch devices.
So indeed probably replacing "touchmove" with "touchstart" is better idea than what i suggested
Curious2021
I'm noticing that the editor doesn't seem to recognize the Apple pencil when dragging pieces to the board. But when I use my fingers it recognizes the pieces correctly.
I'm on android & I do not use pencil. I'm facing the issue with touch (finger) input.
I noticed this issue happens only variants with "side board editor with some piece". So particularly with these variants only* - Placement, Sittuyin, Gorogoro+, S-chess, S-House, Synochess, Shinobi
https://user-images.githubusercontent.com/48226312/164954722-421ebda7-22ac-4f66-b98e-bc71f9a057fa.mp4
I hope this information somehow help the devs. Thanks.
I can't add pieces to the pocket in drop variants (f.e. Shogi) as well. (Android+Mobile Chrome) But can add pieces (DnD) to the board. All in all DnD handling code is not the same when the target is the board or the pocket.