Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(mobile): swipe back gesture fixes (#3382)

Peter Chinman9e0abf5ddf47
diff --git a/js/app/packages/app/component/split-layout/mobile/MobileSwipeBackContainer.tsx b/js/app/packages/app/component/split-layout/mobile/MobileSwipeBackContainer.tsx
index 48788ad945..3b5d6e9b5a 100644
--- a/js/app/packages/app/component/split-layout/mobile/MobileSwipeBackContainer.tsx
+++ b/js/app/packages/app/component/split-layout/mobile/MobileSwipeBackContainer.tsx
@@ -77,6 +77,13 @@ export function MobileSwipeBackContainer(props: MobileSwipeBackContainerProps) {
if (!mobileSwipeLayout.canGoBack()) return;
const touch = e.touches[0];
if (!touch || touch.clientX > SWIPE_EDGE_THRESHOLD) return;
+ // Buttons can sit inside the swipe-edge zone. If we start the gesture, the preventDefault() in touchmove suppresses the synthesized click on iOS.
+ if (
+ e.target instanceof Element &&
+ e.target.closest('button, a, [role="button"]')
+ ) {
+ return;
+ }
startX = touch.clientX;
startTime = Date.now();
setIsDragging(true);
@@ -176,7 +183,7 @@ export function MobileSwipeBackContainer(props: MobileSwipeBackContainerProps) {
},
!mobileSwipeLayout.fgIsSlotA() &&
!isDragging() &&
- !isAnimatingOut &&
+ !isAnimatingOut() &&
'hidden'
)}
style={mobileSwipeLayout.fgIsSlotA() ? fgStyle() : bgStyle()}