From 9665788d4987479d0342fe0bb4db4beec22cf3a5 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Sat, 9 Mar 2024 09:48:43 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix:=20Aux=20Preview=20Touch=20E?= =?UTF-8?q?vents=20Being=20Blocked=20During=20Animation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...MenuView+UIContextMenuInteractionDelegate.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ios/Sources/RNIContextMenuView/RNIContextMenuView+UIContextMenuInteractionDelegate.swift b/ios/Sources/RNIContextMenuView/RNIContextMenuView+UIContextMenuInteractionDelegate.swift index 8af47217..efe2afd6 100644 --- a/ios/Sources/RNIContextMenuView/RNIContextMenuView+UIContextMenuInteractionDelegate.swift +++ b/ios/Sources/RNIContextMenuView/RNIContextMenuView+UIContextMenuInteractionDelegate.swift @@ -47,11 +47,16 @@ extension RNIContextMenuView: UIContextMenuInteractionDelegate { self.isContextMenuVisible = true; guard let animator = animator else { return }; - self.isUserInteractionEnabled = false; - self.menuAuxiliaryPreviewView?.isUserInteractionEnabled = false; - if self.shouldPreventLongPressGestureFromPropagating { + self.isUserInteractionEnabled = false; + self.menuAuxiliaryPreviewView?.isUserInteractionEnabled = false; + self.closestParentReactTouchHandler?.cancel(); + + DispatchQueue.main.async { + self.isUserInteractionEnabled = true; + self.menuAuxiliaryPreviewView?.isUserInteractionEnabled = true; + }; }; self.onMenuWillShow.callAsFunction([:]); @@ -64,9 +69,6 @@ extension RNIContextMenuView: UIContextMenuInteractionDelegate { ); animator.addCompletion { [unowned self] in - self.isUserInteractionEnabled = true; - self.menuAuxiliaryPreviewView?.isUserInteractionEnabled = true; - self.onMenuDidShow.callAsFunction([:]); }; };