Skip to content

Commit c2a1961

Browse files
authored
Minor Fixes to View Transition Fixture (facebook#32664)
Follow up to facebook#32656. Remove touchAction from SwipeRecognizer. I was under the wrong impression that this was only the touch-action applied to this particular element, but that parents would still win but in fact this blocks the parent from scrolling in the other direction. By specifying a fixed direction it also blocked rage-swiping in the other direction early on. Disable pointer-events on view-transition so that the scroll can be hit. This means that touches hit below the items animating above. This allows swiping to happen again before momentum scroll has finished. Previously they were ignored. This only works as long as the SwipeRecognizer is itself not animating. This means you can now rage-swipe in both directions quickly.
1 parent 6584a6e commit c2a1961

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fixtures/view-transition/src/components/Chrome.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ body {
77
padding: 0;
88
font-family: sans-serif;
99
}
10+
11+
::view-transition-group(*),
12+
::view-transition-image-pair(*),
13+
::view-transition-old(*),
14+
::view-transition-new(*) {
15+
pointer-events: none;
16+
}

fixtures/view-transition/src/components/SwipeRecognizer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export default function SwipeRecognizer({
9292
width: axis === 'x' ? '100%' : null,
9393
height: axis === 'y' ? '100%' : null,
9494
overflow: 'scroll hidden',
95-
touchAction: 'pan-' + direction,
9695
// Disable overscroll on Safari which moves the sticky content.
9796
// Unfortunately, this also means that we disable chaining. We should only disable
9897
// it if the parent is not scrollable in this axis.

0 commit comments

Comments
 (0)