Comments (2)
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
from react-spectrum.
We did not include keyboard interactions in useLongPress
by default because they often differ between components. For example, in a button with both normal and long press mouse/touch interactions, you might use Alt + Enter or Alt + ArrowDown to open a long press menu. We could potentially make it configurable, but it doesn't seem too hard to use useLongPress
in combination with your own onKeyDown
listener either.
from react-spectrum.
Related Issues (20)
- Use `null` instead of `Number.NaN` in NumberField component HOT 1
- Button inside label triggers dropdown to open HOT 1
- Add `isToday` to `CalendarCellRenderProps` HOT 2
- Re-rendering the entire list of elements (ComboBox list) HOT 7
- Remix Link with useLink causes FocusRing to appear when clicked HOT 5
- Native validation doesn't dismiss errors as the user corrects them HOT 11
- Expose `isRTL` utility function
- useDateSegment crashes on null reference during unmount HOT 1
- Adjusting screen reader (VoiceOver MacOS) reading order for a react-aria-components HOT 1
- Context Slots are not Extensible HOT 1
- NumberField step attribute doesn't work for values with more than 3 fraction digits HOT 2
- `createLeafComponent` Outputs Incorrect RefAttributes Type HOT 2
- Sticky `data-hovered` on `Row` if `Popover` can be opened from inside it HOT 5
- [Calendar/RangeCalendar] Allow controlling visibleRange
- Display DatePicker calendar popover when the date segments gain focus
- Select / ComboBox Open State isn't Persisted into Button's isPressed Render Prop HOT 2
- GridList renderEmptyState cannot be a Component with Hooks HOT 2
- (0 , $lislG$swchelperscjs_class_private_field_initcjs._) is not a function HOT 1
- [RAC] NumberField really strange behavior HOT 3
- Tooltip causing ResizeObserver issue HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spectrum.