chessboardjs
chessboardjs copied to clipboard
fix - drag durring opponent's turn
Sorry for my language. Bug - When player drag piece durring opponent's turn, piece appears on board after opponent's move. Decision - It is check position on source dragged.
https://github.com/oakmac/chessboardjs/pull/42/files - other decision for this bug
var board2 = new ChessBoard('board2', { draggable: true, dropOffBoard: 'trash', sparePieces: true }); $('#startBtn').on('click', board2.start); $('#clearBtn').on('click', board2.clear);
Thanks andrei-markeev and MaligynK for this fix. Now is there a way to trash the dragged piece if it's been captured by the opponent in the meantime?