Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Board Editor: Tap to place piece#2126

Open
bclehmann wants to merge 3 commits intolichess-org:masterfrom
bclehmann:feature/board-editor/tap-to-place
Open

Board Editor: Tap to place piece#2126
bclehmann wants to merge 3 commits intolichess-org:masterfrom
bclehmann:feature/board-editor/tap-to-place

Conversation

@bclehmann
Copy link

On the board editor page, you used to only be able to add new pieces by dragging them onto the board. This always bugged me, and I imagine it must be horrible on tablets due to the large screen and large distance to drag. I also thought there was something wrong with the app when I tried to tap and it didn't work.

This adds a pieceInHand to Chessground.state, which holds both the piece, and whether it should overwrite the piece under it when placed. Clicking a piece in the bottom panel populates this property. Clicking anywhere on the board will place the piece and clear the pieceInHand property.

I'm unsure about the last part, it may be useful to not clear the pieceInHand, so the user can place all the pieces of a given type and colour at once. But this would also require a button to clear the field, and potentially some UI work to communicate that there is a piece in hand.

Lastly, my apologies if this is suboptimally implemented, I'm very new to the codebase and I've scarcely convinced it to build on my machine.

@bclehmann bclehmann force-pushed the feature/board-editor/tap-to-place branch from d492f5d to 423565a Compare June 11, 2022 03:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant