Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sliding your finger in coordinate trainer continues to select squares #1017

Open
EmmetSchuler opened this issue Sep 13, 2024 · 3 comments · May be fixed by lichess-org/flutter-chessground#66 or #1311
Labels
bug Something isn't working

Comments

@EmmetSchuler
Copy link

What is the problem?

When using the coordinate trainer, players tap on the square in order to select it. However as of now players can slide their finger around and it will continue to select the square under their finger.
This can be confusing, because no other board behaves in this way. I also don't believe this is intended behavior.

Steps to reproduce the bug

Go to coordinate trainer
Tap your finger on a square
Now continue to drag your finger across the board

Expected: no more inputs are received until you lift your finger up and down again
What happened: Inputs are received as long as the finger remains moving

App version

0.11.0

Device Info

Pixel 6 and Android 14

Additional information

No response

@EmmetSchuler EmmetSchuler added the bug Something isn't working label Sep 13, 2024
@sid0-0
Copy link

sid0-0 commented Sep 19, 2024

To fix this issue we'll need to make a change in the lib/src/widgets/board_editor.dart flutter package file since it's code specifies calling the same function on tap and drag actions. Can someone help me with where I will need to make the changes and also publish a new version?

Files for reference:

  1. lib/src/view/coordinate_training/coordinate_training_screen.dart - onGuess method called inside function passed to onEditedSquare on tap/drag.
  2. [user_path]/.pub-cache/hosted/pub.dev/chessground-5.1.1/lib/src/widgets/board_editor.dart - _onTouchedEvent calls onEditedSquare

@tom-anders
Copy link
Collaborator

tom-anders commented Sep 19, 2024

You'd need to make a PR at https://github.com/lichess-org/flutter-chessground

Note however, that this behavior is actually intended for the actual board editor (so that you can drag a finger across the board and delete pieces at every location it touches for example).

So probably, the solution would be to add a new field to the EditorPointerMode enum that has the intended behavior

@veloce
Copy link
Contributor

veloce commented Oct 16, 2024

Another way of fixing it is to add an onTappedSquare to the Chessboard widget (and don't use the BoardEditor widget.

tom-anders added a commit to tom-anders/flutter-chessground that referenced this issue Dec 26, 2024
We'll need this if we want to switch the coordinate trainer in the app
from `ChessboardEditor` to `Chessboard` in order to fix lichess-org/mobile#1017
tom-anders added a commit to tom-anders/lichess-mobile that referenced this issue Dec 26, 2024
tom-anders added a commit to tom-anders/lichess-mobile that referenced this issue Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants