Skip to content

Commit d36e77f

Browse files
iOS: scroll lock should still allow pinch-to-zoom
1 parent b6f355d commit d36e77f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export function handleIOSLocking(): ScrollLockStep<ContainerMetadata> {
8383

8484
d.style(rootContainer, 'overscrollBehavior', 'contain')
8585
} else {
86-
d.style(e.target, 'touchAction', 'none')
86+
// Disable all touch actions related to scrolling,
87+
// but still allow pinch-to-zoom.
88+
d.style(e.target, 'touchAction', 'pinch-zoom')
8789
}
8890
}
8991
})

packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export function handleIOSLocking(): ScrollLockStep<ContainerMetadata> {
8383

8484
d.style(rootContainer, 'overscrollBehavior', 'contain')
8585
} else {
86-
d.style(e.target, 'touchAction', 'none')
86+
// Disable all touch actions related to scrolling,
87+
// but still allow pinch-to-zoom.
88+
d.style(e.target, 'touchAction', 'pinch-zoom')
8789
}
8890
}
8991
})

0 commit comments

Comments
 (0)