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

Pieces not doing what they are supposed to. #176

Open
quackquavk opened this issue Dec 10, 2024 · 1 comment
Open

Pieces not doing what they are supposed to. #176

quackquavk opened this issue Dec 10, 2024 · 1 comment

Comments

@quackquavk
Copy link

quackquavk commented Dec 10, 2024

In my online games page, the pieces are acting weird when dragged.

Screen.Recording.2024-12-10.at.18.11.41.mov

no sure why this is happening.

  <Chessboard
                    onSquareClick={onSquareClick}
                    customSquareStyles={memoizedHighlightSquares}
                    position={gameState.fen}
                    customDarkSquareStyle={{ backgroundColor: theme[1] }}
                    customLightSquareStyle={{ backgroundColor: theme[0] }}
                    onPieceDrop={onDrop}
                    boardOrientation={gameState.playerColor || "white"}
                    animationDuration={animationDuration}
                    arePremovesAllowed={true}
                    showPromotionDialog={promotionDialogue}
                    arePiecesDraggable={!gameFull}
                    promotionToSquare={promotionToSquare}
                    onPromotionPieceSelect={handlePromotion}
                    customBoardStyle={{
                      borderRadius: '0.75rem',
                      overflow: 'hidden',
                      boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.5)',
                    }}
                  />```
@mmaciesowicz
Copy link

If I had to make a guess, I think you might have adjusted the size or positioning of the board in some parent container and it is messing with the CustomDragLayer component. To confirm, can you also provide the styling to the container/Chessboard component as well? In the meantime, you can try using the boardWidth parameter for Chessboard instead to see if that fixes anything.

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

2 participants