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
{{ message }}
Repository navigation
Commit 42e8b5b
Browse filesBrowse the repository at this point in the historyBrowse files
## Description
Documents `onHoverIn`/`onHoverOut` on the `Touchable` page, together
with the behaviour that isn't obvious from the signature: how the two
pair up, what `disabled` does to an open hover, which platforms report
the crossings during a press, tvOS driving hover from focus, and hover
state not surviving an unmount or a detach.
## Test plan
`yarn start` in `packages/docs-gesture-handler`.
@@ -449,12 +458,93 @@ Triggered when the button gets pressed (analogous to `onPress` in `Pressable` fr
449
458
450
459
### onLongPress
451
460
452
-
```ts
453
-
onLongPress?: () =>void;
454
-
```
461
+
<CollapsibleCode
462
+
label="Show composed types definitions"
463
+
expandedLabel="Hide composed types definitions"
464
+
lineBounds={[0, 1]}
465
+
src={`
466
+
onLongPress?: (e: ButtonEvent) => void;
467
+
468
+
type ButtonEvent = {
469
+
pointerInside: boolean;
470
+
x: number;
471
+
y: number;
472
+
absoluteX: number;
473
+
absoluteY: number;
474
+
numberOfPointers: number;
475
+
pointerType: PointerType;
476
+
}
477
+
478
+
enum PointerType {
479
+
TOUCH,
480
+
STYLUS,
481
+
MOUSE,
482
+
KEY,
483
+
OTHER,
484
+
}
485
+
`}/>
455
486
456
487
Triggered when the button gets pressed for at least [`delayLongPress`](#delaylongpress) milliseconds.
457
488
489
+
### onHoverIn
490
+
491
+
<CollapsibleCode
492
+
label="Show composed types definitions"
493
+
expandedLabel="Hide composed types definitions"
494
+
lineBounds={[0, 1]}
495
+
src={`
496
+
onHoverIn?: (e: ButtonEvent) => void;
497
+
498
+
type ButtonEvent = {
499
+
pointerInside: boolean;
500
+
x: number;
501
+
y: number;
502
+
absoluteX: number;
503
+
absoluteY: number;
504
+
numberOfPointers: number;
505
+
pointerType: PointerType;
506
+
}
507
+
508
+
enum PointerType {
509
+
TOUCH,
510
+
STYLUS,
511
+
MOUSE,
512
+
KEY,
513
+
OTHER,
514
+
}
515
+
`}/>
516
+
517
+
Triggered when a non-touch pointer - a mouse, a trackpad cursor, or a hovering stylus - moves over the button (analogous to `onHoverIn` in `Pressable` from RN core). Touch pointers never report hover.
518
+
519
+
### onHoverOut
520
+
521
+
<CollapsibleCode
522
+
label="Show composed types definitions"
523
+
expandedLabel="Hide composed types definitions"
524
+
lineBounds={[0, 1]}
525
+
src={`
526
+
onHoverOut?: (e: ButtonEvent) => void;
527
+
528
+
type ButtonEvent = {
529
+
pointerInside: boolean;
530
+
x: number;
531
+
y: number;
532
+
absoluteX: number;
533
+
absoluteY: number;
534
+
numberOfPointers: number;
535
+
pointerType: PointerType;
536
+
}
537
+
538
+
enum PointerType {
539
+
TOUCH,
540
+
STYLUS,
541
+
MOUSE,
542
+
KEY,
543
+
OTHER,
544
+
}
545
+
`}/>
546
+
547
+
Triggered when the hovering pointer leaves the button (analogous to `onHoverOut` in `Pressable` from RN core).
0 commit comments