Disabling Drag Gesture on Button in paged TabView

I have an app consisting of three paged tabviews. The center (main) view has two big buttons in the middle (hstacked). I'd like the buttons to be unresponsive to swipes (so that any touches there don't accidentally result in change of views).

I tried adding a .gesture(DragGesture()), but that didn't do anything. I also added GestureMask to that, but only the .all option made a difference, however it also (of course) disabled the needed tapping on the buttons.

This can't be a new problem, but I failed in my googling of it. Thanks for any help provided.

Answered by BabyJ in 718638022

Trying adding this to the buttons:

.highPriorityGesture(DragGesture())

em...what do you mean by unresponsive to swipes?😂 sorry i have terrible comprehending

Accepted Answer

Trying adding this to the buttons:

.highPriorityGesture(DragGesture())

Sorry, that’s on me. I meant that if you try tapping the button, but accidentally slightly move your finger as you tap, it won’t register it as a swipe. BabyJ solution below works. Yay, BabyJ!

Disabling Drag Gesture on Button in paged TabView
 
 
Q