Clariity / react-chessboard

The React Chessboard Library used at ChessOpenings.co.uk. Inspired and adapted from the unmaintained Chessboard.jsx.
https://react-chessboard.vercel.app
MIT License
335 stars 101 forks source link

SparePiece does not get dragged. #156

Closed sbeben closed 2 days ago

sbeben commented 3 weeks ago

Hello there, thanks for your amazing library!

I am building a chess app, where in the beginning you have to place pieces by yourself. Seems like SparePiece component is a perfect solution for me. But, when I use it like this:

 <DnDProvider backend={HTML5Backend}>
        <Board
          boardWidth={400}
        />
        <SparePiece width={40} piece="bB" dndId={"123123"} />
      </DnDProvider>

i can grab the piece, but it's not following my cursor. However, if i continue to drag and drag over the board - the squares start to glow yellow and when I drop it - it takes it's place on the board. So, everything is perfect, except the piece is not following the cursor while being dragged.

Don't you think this behaviour should be implemented by default? Can you even accomplish that? Is there any workaround on your mind for that? With regards.

Clariity commented 2 weeks ago

Please follow the example shown in the Storybook

https://react-chessboard.vercel.app/?path=/story/chessboard--manual-board-editor