diff --git a/packages/chess/src/ui/Board.tsx b/packages/chess/src/ui/Board.tsx index 1bba8b3..bc722ff 100644 --- a/packages/chess/src/ui/Board.tsx +++ b/packages/chess/src/ui/Board.tsx @@ -125,14 +125,20 @@ export function Board({ facts, legalMoves, onMove, turn, lastMove, checkedKingSq const isCheckedKing = checkedKingSquare === sq; const piece = pieces.get(sq); - + // While this cell hosts the actively-dragged piece, lift the whole + // cell above all siblings in the grid. Z-index inside the + // component can only stack within its own cell's stacking context, + // so the piece would render *under* neighbouring cells' pieces when + // translated over them. Promoting the cell itself fixes that. + const isHostingDragged = draggedPiece?.square === sq; + squares.push(
handleDragOver(e, sq)} onDrop={(e) => handleDrop(e, sq)} >