Add onPressedButNotHeld callback to usePressHoldRelease hook#62
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 <23391587+ngenovese11@users.noreply.github.com>
Co-authored-by: ngenovese11 <23391587+ngenovese11@users.noreply.github.com>
|
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 📦🚀 |
|
🎉 This PR is included in version 1.23.0-ci-updates.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.23.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
onPressedButNotHeldparameter to thePressHoldReleaseParamsinterfaceheldref to track whether the button was actually held during the interactiononPointerDownto reset theheldstate and set it totruewhen the hold timer firesonPointerUpto check theheldstate and conditionally callonPressedButNotHeldfor short pressesThe hook now distinguishes between:
onPress→onRelease→onPressedButNotHeldonPress→onHold→onRelease(noonPressedButNotHeld)All existing behavior for
onPress,onRelease, andonHoldremains 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.