From e13ba0c4bce584e03f170e2a26c30a052a065beb Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 3 May 2024 10:28:41 -0400 Subject: [PATCH] Update --- .../hooks/document-overflow/handle-ios-locking.ts | 12 ++++++------ .../hooks/document-overflow/handle-ios-locking.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts b/packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts index 204dca093c..3a70893e8f 100644 --- a/packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts +++ b/packages/@headlessui-react/src/hooks/document-overflow/handle-ios-locking.ts @@ -94,13 +94,13 @@ export function handleIOSLocking(): ScrollLockStep { (e) => { // Check if we are scrolling inside any of the allowed containers, if not let's cancel the event! if (e.target instanceof HTMLElement) { - if (inAllowedContainer(e.target as HTMLElement)) { - // Some inputs like `` use touch events to - // allow interaction. We should not prevent this event. - if (e.target.tagName === 'INPUT') { - return - } + // Some inputs like `` use touch events to + // allow interaction. We should not prevent this event. + if (e.target.tagName === 'INPUT') { + return + } + if (inAllowedContainer(e.target as HTMLElement)) { // Even if we are in an allowed container, on iOS the main page can still scroll, we // have to make sure that we `event.preventDefault()` this event to prevent that. // diff --git a/packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts b/packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts index 012e6bcdcc..de139c19f8 100644 --- a/packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts +++ b/packages/@headlessui-vue/src/hooks/document-overflow/handle-ios-locking.ts @@ -94,13 +94,13 @@ export function handleIOSLocking(): ScrollLockStep { (e) => { // Check if we are scrolling inside any of the allowed containers, if not let's cancel the event! if (e.target instanceof HTMLElement) { - if (inAllowedContainer(e.target as HTMLElement)) { - // Some inputs like `` use touch events to - // allow interaction. We should not prevent this event. - if (e.target.tagName === 'INPUT') { - return - } + // Some inputs like `` use touch events to + // allow interaction. We should not prevent this event. + if (e.target.tagName === 'INPUT') { + return + } + if (inAllowedContainer(e.target as HTMLElement)) { // Even if we are in an allowed container, on iOS the main page can still scroll, we // have to make sure that we `event.preventDefault()` this event to prevent that. //