StackedRouter: prevent ios default swipe to back
All checks were successful
/ depoly (push) Successful in 1m22s
All checks were successful
/ depoly (push) Successful in 1m22s
This commit is contained in:
parent
1a7a52da22
commit
9065a18061
1 changed files with 4 additions and 3 deletions
|
@ -15,9 +15,7 @@ import { createStore, unwrap } from "solid-js/store";
|
||||||
import "./StackedRouter.css";
|
import "./StackedRouter.css";
|
||||||
import { animateSlideInFromRight, animateSlideOutToRight } from "./anim";
|
import { animateSlideInFromRight, animateSlideOutToRight } from "./anim";
|
||||||
import { ANIM_CURVE_DECELERATION, ANIM_CURVE_STD } from "../material/theme";
|
import { ANIM_CURVE_DECELERATION, ANIM_CURVE_STD } from "../material/theme";
|
||||||
import {
|
import { makeEventListener } from "@solid-primitives/event-listener";
|
||||||
makeEventListener,
|
|
||||||
} from "@solid-primitives/event-listener";
|
|
||||||
|
|
||||||
export type StackedRouterProps = Omit<RouterProps, "url">;
|
export type StackedRouterProps = Omit<RouterProps, "url">;
|
||||||
|
|
||||||
|
@ -314,6 +312,9 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
|
||||||
origX = x;
|
origX = x;
|
||||||
origWidth = width;
|
origWidth = width;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
const lastFr = stack[stack.length - 1];
|
const lastFr = stack[stack.length - 1];
|
||||||
const createAnimation = lastFr.animateClose ?? animateClose;
|
const createAnimation = lastFr.animateClose ?? animateClose;
|
||||||
reenterableAnimation = createAnimation(event.currentTarget);
|
reenterableAnimation = createAnimation(event.currentTarget);
|
||||||
|
|
Loading…
Reference in a new issue