You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tracked the bug down to this commit: 4b5b4ae that fixes a bug about duplicate select event.
Commenting this line...
elseif(e.touches)return;// Handle only corresponding mouse event https://github.com/lichess-org/chessground/pull/268
...avoids the issue (at the expense of duplicate select events).
This behavior was found when embedding chessground into an Ionic webapp. Ionic sets touch-action: manipulation in the body element (and also has some class like 'inner-scroll' with touch-action: pan-x pan-y pinch-zoom; that also breaks drag&drop).
I don't know what could be an ideal solution. A workaround could be set a new configuration param to enable/disable the line "else if (e.touches) return;" but it looks dirty.
Plain chessground => works ok
Chessground + Ionic => drag&drop doesn't work on mobile
Chessground + touch-action: manipulation => drag&drop doesn't work on mobile
Click "Open Sandbox" to see the code.
I have this workaround to make it work with Ionic:
Ionic sets touch-action: manipulation to avoid the delay of click events due to the need of checking double-tap to zoom gesture.
manipulation
Enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. Disabling double-tap to zoom removes the need for browsers to delay the generation of click events when the user taps the screen. This is an alias for "pan-x pan-y pinch-zoom" (which, for compatibility, is itself still valid).
If I embed a chessground element inside a parent element with the style "touch-action: manipulation", drag&drop stops working on mobile.
main.ts
I've tracked the bug down to this commit: 4b5b4ae that fixes a bug about duplicate select event.
Commenting this line...
...avoids the issue (at the expense of duplicate select events).
This behavior was found when embedding chessground into an Ionic webapp. Ionic sets touch-action: manipulation in the body element (and also has some class like 'inner-scroll' with touch-action: pan-x pan-y pinch-zoom; that also breaks drag&drop).
I don't know what could be an ideal solution. A workaround could be set a new configuration param to enable/disable the line "else if (e.touches) return;" but it looks dirty.
Here you have a demo to check the behavior: https://7vy38h.csb.app
Plain chessground => works ok
Chessground + Ionic => drag&drop doesn't work on mobile
Chessground + touch-action: manipulation => drag&drop doesn't work on mobile
Click "Open Sandbox" to see the code.
I have this workaround to make it work with Ionic:
The text was updated successfully, but these errors were encountered: