From 9065a18061eb52029acd9a1b28ec5d8368fe218f Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 18 Nov 2024 21:42:40 +0800 Subject: [PATCH] StackedRouter: prevent ios default swipe to back --- src/platform/StackedRouter.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/platform/StackedRouter.tsx b/src/platform/StackedRouter.tsx index e1477f1..19ac062 100644 --- a/src/platform/StackedRouter.tsx +++ b/src/platform/StackedRouter.tsx @@ -15,9 +15,7 @@ import { createStore, unwrap } from "solid-js/store"; import "./StackedRouter.css"; import { animateSlideInFromRight, animateSlideOutToRight } from "./anim"; import { ANIM_CURVE_DECELERATION, ANIM_CURVE_STD } from "../material/theme"; -import { - makeEventListener, -} from "@solid-primitives/event-listener"; +import { makeEventListener } from "@solid-primitives/event-listener"; export type StackedRouterProps = Omit; @@ -314,6 +312,9 @@ const StackedRouter: Component = (oprops) => { origX = x; origWidth = width; + event.preventDefault(); + event.stopPropagation(); + const lastFr = stack[stack.length - 1]; const createAnimation = lastFr.animateClose ?? animateClose; reenterableAnimation = createAnimation(event.currentTarget);