Skip to content

Commit

Permalink
🐞 Fix: Aux Preview Touch Events Being Blocked During Animation
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Mar 9, 2024
1 parent cb59650 commit 9665788
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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([:]);
Expand All @@ -64,9 +69,6 @@ extension RNIContextMenuView: UIContextMenuInteractionDelegate {
);

animator.addCompletion { [unowned self] in
self.isUserInteractionEnabled = true;
self.menuAuxiliaryPreviewView?.isUserInteractionEnabled = true;

self.onMenuDidShow.callAsFunction([:]);
};
};
Expand Down

0 comments on commit 9665788

Please sign in to comment.