StackedRouter: try to fix the swipe to back
All checks were successful
/ depoly (push) Successful in 1m21s

This commit is contained in:
thislight 2024-11-18 23:59:14 +08:00
parent e124d3e5b8
commit 4d3f5c911b
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -306,10 +306,7 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
}
const [fig0] = event.touches;
const { x, width } = event.currentTarget.getBoundingClientRect();
if (
fig0.clientX - fig0.radiusX < x - 22 ||
fig0.clientX + fig0.radiusX > x + 22
) {
if (fig0.clientX < x - 22 || fig0.clientX > x + 22) {
return;
}
origX = x;
@ -416,10 +413,10 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
class="StackedPage"
onCancel={[popFrame, 1]}
onClick={[onDialogClick, popFrame]}
onTouchStart={onDialogTouchStart}
onTouchMove={onDialogTouchMove}
onTouchEnd={onDialogTouchEnd}
onTouchCancel={onDialogTouchCancel}
on:touchstart={onDialogTouchStart}
on:touchmove={onDialogTouchMove}
on:touchend={onDialogTouchEnd}
on:touchcancel={onDialogTouchCancel}
id={frame().rootId}
>
<StaticRouter url={frame().path} {...oprops} />