-
-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Adding ViewModifier to view causes bounds overflow crash, in any browser.
You need to have enough examples for it to happen. (2x didn't trigger) but below code, does the trick for me
HStack {
Rectangle()
.fill(Color.purple)
.frame(width: 100, height: 100)
.onTapGesture() {
print("🟢 1st gesture")
}
.onTapGesture() {
print("🟢 2nd gesture, should not be called")
}
.onTapGesture() {
print("🟢 3rd gesture, should not be called")
}
.simultaneousGesture(
TapGesture().onEnded({ _ in
print("🟢 simultaneousGesture gesture")
})
)
.onLongPressGesture {
print("🟢 onLongPressGesture")
}
Text("Tap Parent")
}
.background(
Color.gray
.onTapGesture() {
print("🩶 Background gesture")
}
)
.onTapGesture() {
print("🔵 Parent gesture")
}
Used code to trigger the issue
private struct GesturePreferenceModifier<G: Gesture>: ViewModifier {
let gesture: G
func body(content: Content) -> some View {
GestureView( gesture: gesture, content: content )
}
}
with the modifier applied like this:
modifier(GesturePreferenceModifier(gesture: gesture.body))
To Reproduce
Steps to reproduce the behavior:
- Create a preference key
- Create HStack View with modifier applied to it and its subviews
- change state (i.e. on tap)
- See error
Expected behavior
App works as expected
Screenshots
Desktop (please complete the following information):
- OS: Ventura 13.4.1
- Browser safari, chrome
- Version of the 16.5.2
- Version of Tokamak Gesture Support branch
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working