react-chessboard-ui 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2607,9 +2607,13 @@ var useChessBoardInteractive = function useChessBoardInteractive(props) {
2607
2607
  clearClickedPos();
2608
2608
  clearClickPossibleMoves();
2609
2609
  };
2610
- var handleClick = function handleClick(cellPos) {
2610
+ var handleClick = function handleClick(cellPos, viewOnly) {
2611
+ if (viewOnly === void 0) {
2612
+ viewOnly = false;
2613
+ }
2611
2614
  clearMarkedCells();
2612
2615
  clearArrows();
2616
+ if (viewOnly) return;
2613
2617
  if (clickedPos[0] === -1) {
2614
2618
  selectClickFrom(cellPos);
2615
2619
  return;
@@ -2970,7 +2974,9 @@ var ChessBoard = function ChessBoard(props) {
2970
2974
  boardConfig: boardConfig
2971
2975
  }), React.createElement(ChessBoardControlLayout, {
2972
2976
  boardConfig: boardConfig,
2973
- onClick: handleClick,
2977
+ onClick: function onClick(pos) {
2978
+ return handleClick(pos, viewOnly);
2979
+ },
2974
2980
  onGrabStart: viewOnly ? function () {} : selectHoverFrom,
2975
2981
  onGrabStartRight: startRenderArrow,
2976
2982
  onGrabEnd: viewOnly ? function () {} : handleGrabEnd,