Skip to content

Commit c5349b0

Browse files
fix: ldMask interfere with hit view testing (#108)
Use .allowsHitTesting(false) isUserInteractionEnabled = false to turn off possible hit interfering <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Prevents the Session Replay overlay from intercepting user interactions. > > - Replace `disabled(true)` with `allowsHitTesting(false)` on the SwiftUI overlay in `SessionReplayModifier` > - Set `isUserInteractionEnabled = false` on the `MaskView` in `SessionReplayViewRepresentable.makeUIView` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 55acca7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 7ae4481 commit c5349b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/LaunchDarklySessionReplay/API/SessionReplayModifier.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct SessionReplayModifier: ViewModifier {
88
public func body(content: Content) -> some View {
99
content.overlay(
1010
SessionReplayViewRepresentable(isEnabled: isEnabled, isIgnored: isIgnored)
11-
.disabled(true)
11+
.allowsHitTesting(false)
1212
)
1313
}
1414
}
@@ -27,7 +27,9 @@ struct SessionReplayViewRepresentable: UIViewRepresentable {
2727
class MaskView: UIView { }
2828

2929
public func makeUIView(context: Context) -> MaskView {
30-
MaskView()
30+
let view = MaskView()
31+
view.isUserInteractionEnabled = false
32+
return view
3133
}
3234

3335
public func updateUIView(_ uiView: MaskView, context: Context) {

0 commit comments

Comments
 (0)