You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enter and Space are both used as alternatives in usePress(). However, keyboard events are explicitly filtered out from useLongPress(). The documentation does warn that you should provide an alternative, which makes sense given that some users will not be able to hold a key easily.
But there's still a use case for allowing Space and Enter to perform a long press, for example it's a common interaction for "temporary pausing" such as a in carousels or 'Stories' features in many social apps.
🤔 Expected Behavior?
Space and Enter should activate long presses
😯 Current Behavior
Space and Enter do not activate long presses
💁 Possible Solution
No response
🔦 Context
Had to reimplement useLongPress() in order to get this behavior
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
Are those actually long presses? I tried Stories with touch, and it pauses until the press is ended. But long press finishes after about half a second, which would be a different behavior. If you used useLongPress for this, it'd only pause the video for half a second and then it would resume. Seems like useLongPress isn't the right thing to use for this interaction pattern to begin with?
It also doesn't take a long press for the keyboard version of the interaction, just a quick tap of the 'Space' key will pause a video.
Maybe you can provide more details about what you're building, or an example app? Maybe some interaction patterns are being conflated. For instance, I think you can just use usePress with onPressStart and onPressEnd and use the interaction mode to determine what actions to take.
Something along these lines?
Touch: pause on press start, resume on press end
Mouse: toggle pause on press
Keyboard: toggle pause on press
Provide a general summary of the feature here
Enter and Space are both used as alternatives in
usePress()
. However, keyboard events are explicitly filtered out fromuseLongPress()
. The documentation does warn that you should provide an alternative, which makes sense given that some users will not be able to hold a key easily.But there's still a use case for allowing
Space
andEnter
to perform a long press, for example it's a common interaction for "temporary pausing" such as a in carousels or 'Stories' features in many social apps.🤔 Expected Behavior?
Space and Enter should activate long presses
😯 Current Behavior
Space and Enter do not activate long presses
💁 Possible Solution
No response
🔦 Context
Had to reimplement useLongPress() in order to get this behavior
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: