Open History to see the last commit
1diff --git a/ios/Shared/MenuViewImplementation.swift b/ios/Shared/MenuViewImplementation.swift
2index 5c4e0da4292b15d3a27b5ea1555f11452a470815..ea19f2eec02dd78fbc78cc455c91b4e71e734d70 100644
3--- a/ios/Shared/MenuViewImplementation.swift
4+++ b/ios/Shared/MenuViewImplementation.swift
5@@ -88,6 +88,41 @@ public class MenuViewImplementation: UIButton {
7 self.menu = menu
8 self.showsMenuAsPrimaryAction = !shouldOpenOnLongPress
9+ // In long-press mode the button must not intercept touches: as a
10+ // full-bounds contentView it sits IN FRONT of the React children of
11+ // the hosting component view, which would swallow their taps (e.g. a
12+ // row Pressable wrapped by MenuView). The context-menu interaction is
13+ // hosted by the superview instead (see updateLongPressInteraction) so
14+ // long-press and pointer secondary-click still present the menu, with
15+ // the wrapped content as the zoom preview.
16+ self.isUserInteractionEnabled = !shouldOpenOnLongPress
17+ self.updateLongPressInteraction()
18+ }
19+
20+ private var longPressInteraction: UIContextMenuInteraction?
21+
22+ public override func didMoveToSuperview() {
23+ super.didMoveToSuperview()
24+ self.updateLongPressInteraction()
25+ }
26+
27+ private func updateLongPressInteraction() {
28+ if shouldOpenOnLongPress, let host = self.superview {
29+ if let existing = longPressInteraction, existing.view === host {
30+ return
31+ }
32+ if let existing = longPressInteraction {
33+ existing.view?.removeInteraction(existing)
34+ }
35+ let interaction = UIContextMenuInteraction(delegate: self)
36+ host.addInteraction(interaction)
37+ longPressInteraction = interaction
38+ return
39+ }
40+ if let existing = longPressInteraction {
41+ existing.view?.removeInteraction(existing)
42+ longPressInteraction = nil
43+ }
44 }
46 public override func reactSetFrame(_ frame: CGRect) {