fix: 手机左右滑动切换页面不生效 #43
Reference in New Issue
Block a user
Delete Branch "fix/mobile-swipe-tabs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
根因
浏览器默认处理水平手势(iOS Safari 左滑后退、Chrome overscroll),抢在 JS touchend 之前消费了事件。
修复
touch-action: pan-y告诉浏览器只处理垂直滚动,水平留给 JStouchmove实时跟踪手指位置,不再依赖touchend.changedTouches(在某些浏览器中不可靠)touchstart的 target 做 no-swipe 区域判断(移动后 target 可能变)🚀 Preview: https://pr-43.oil.oci.euphon.net
DB is a copy of production.
🗑️ Preview torn down.