Skip to content

Add onPressedButNotHeld callback to usePressHoldRelease hook#62

Merged
aknous merged 4 commits intomainfrom
copilot/fix-61
Apr 6, 2026
Merged

Add onPressedButNotHeld callback to usePressHoldRelease hook#62
aknous merged 4 commits intomainfrom
copilot/fix-61

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 15, 2025

  • Add onPressedButNotHeld parameter to the PressHoldReleaseParams interface
  • Add held ref to track whether the button was actually held during the interaction
  • Update onPointerDown to reset the held state and set it to true when the hold timer fires
  • Update onPointerUp to check the held state and conditionally call onPressedButNotHeld for short presses
  • Enhance JSDoc documentation with updated examples showing the new callback usage
  • Add semantic release compatible commit message to trigger build

The hook now distinguishes between:

  • Short press: onPressonReleaseonPressedButNotHeld
  • Long press: onPressonHoldonRelease (no onPressedButNotHeld)

All existing behavior for onPress, onRelease, and onHold remains unchanged.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 15, 2025

@ngenovese11 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits September 15, 2025 15:15
Co-authored-by: ngenovese11 <23391587+ngenovese11@users.noreply.github.com>
Co-authored-by: ngenovese11 <23391587+ngenovese11@users.noreply.github.com>
Copilot AI changed the title [WIP] Add onPressedButNotHeld callback to usePressHoldRelease hook Add onPressedButNotHeld callback to usePressHoldRelease hook Sep 15, 2025
Copilot AI requested a review from ngenovese11 September 15, 2025 15:20
@ngenovese11
Copy link
Copy Markdown
Contributor

an empty commit needs to be added with the "feat:" prefix to trigger a build via semantic release @copilot

This feature enables distinct handling of short presses versus holds in the usePressHoldRelease hook.
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 15, 2025

an empty commit needs to be added with the "feat:" prefix to trigger a build via semantic release @copilot

Added an empty commit with "feat:" prefix to trigger semantic release build. Commit hash: 1ba3694

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.21.0-copilot-fix-61.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ngenovese11 ngenovese11 marked this pull request as ready for review September 15, 2025 15:38
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.21.0-merge-press-and-hold-hook.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@aknous aknous merged commit 319e827 into main Apr 6, 2026
3 checks passed
@aknous aknous deleted the copilot/fix-61 branch April 6, 2026 21:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🎉 This PR is included in version 1.23.0-ci-updates.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🎉 This PR is included in version 1.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants