-
Notifications
You must be signed in to change notification settings - Fork 0
Add onPressedButNotHeld callback to usePressHoldRelease hook #62
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
base: main
Are you sure you want to change the base?
Conversation
@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. |
Co-authored-by: ngenovese11 <[email protected]>
Co-authored-by: ngenovese11 <[email protected]>
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.
🎉 This PR is included in version 1.21.0-copilot-fix-61.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.21.0-merge-press-and-hold-hook.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
onPressedButNotHeld
parameter to thePressHoldReleaseParams
interfaceheld
ref to track whether the button was actually held during the interactiononPointerDown
to reset theheld
state and set it totrue
when the hold timer firesonPointerUp
to check theheld
state and conditionally callonPressedButNotHeld
for short pressesThe hook now distinguishes between:
onPress
→onRelease
→onPressedButNotHeld
onPress
→onHold
→onRelease
(noonPressedButNotHeld
)All existing behavior for
onPress
,onRelease
, andonHold
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.