Skip to content

feat: add onPieceDragCancel option to handle piece drag cancellations#230

Open
miguelmato wants to merge 2 commits into
Clariity:mainfrom
miguelmato:on-drag-cancel-prop
Open

feat: add onPieceDragCancel option to handle piece drag cancellations#230
miguelmato wants to merge 2 commits into
Clariity:mainfrom
miguelmato:on-drag-cancel-prop

Conversation

@miguelmato

Copy link
Copy Markdown

Description

This PR adds onPieceDragCancel prop to be able to customize the UI cleanup when the user explicitly cancel a drag event by right clicking or pressing Escape.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Manual Storybook Testing: Spun up pnpm storybook and verified that right clicking or pressing Escape triggers the callback but drag and dropping a piece outside the board does not.
  • Static Testing: Ran pnpm test:static locally to ensure no TypeScript compilation errors or Prettier formatting
    issues were introduced by the updated ChessboardOptions type definitions.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

@miguelmato is attempting to deploy a commit to the Ryan Gregory's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant