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