Skip to content

onMoveEnd/onChange and onDrop different output #245

Open
@eparisio

Description

@eparisio

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions