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

onMoveEnd/onChange and onDrop different output #245

Open
eparisio opened this issue Jun 25, 2023 · 0 comments
Open

onMoveEnd/onChange and onDrop different output #245

eparisio opened this issue Jun 25, 2023 · 0 comments

Comments

@eparisio
Copy link

eparisio commented Jun 25, 2023

Hi, i'm try to implemente chess.js with the board.move() command but i see that the output are different.

onMoveEnd and onChange return the entire board status ({"a8":"bR","b8":"bN","c8":"bB","d8":"bQ","e8":"bK","f8":"bB","g8":"bN","h8":"bR","a7":"bP","b7":"bP","c7":"bP","d7":"bP","e7":"bP","f7":"bP","g7":"bP","h7":"bP","a2":"wP","b2":"wP","c2":"wP","d2":"wP","e2":"wP","f2":"wP","g2":"wP","h2":"wP","a1":"wR","b1":"wN","c1":"wB","d1":"wQ","e1":"wK","f1":"wB","g1":"wN","h1":"wR"}), while onDrop return the new coordinates (e2).
Second problem, onMoveEnd don't accept any 'snapback' event to revert the move.
how i can use the logic in the example with the onMoveEnd? or some other event ending function?
or i must to setup the logic before triggering the board.move() event?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant