update at 2026-03-04 13:25:26
This commit is contained in:
13
pxterm/scripts/archive/cjs_tools/fix_touch_css.cjs
Normal file
13
pxterm/scripts/archive/cjs_tools/fix_touch_css.cjs
Normal file
@@ -0,0 +1,13 @@
|
||||
const fs = require('fs');
|
||||
let code = fs.readFileSync('src/styles/main.css', 'utf8');
|
||||
|
||||
// The reason touchmove stops is because touch events on iOS are sometimes silently swallowed if touch-action is not correct.
|
||||
// Actually, earlier you saw the logs: only `pointermove` is logging!! The `touchmove` ONLY LOGS ONCE!
|
||||
// Safari 13+ on iOS stops emitting touchmove if it emits pointermove, UNLESS we call e.preventDefault() on the touchmove, but since we didn't get touchmove... Wait.
|
||||
// Safari emits touchstart -> pointerdown -> touchmove (if not scrolling) / pointermove.
|
||||
// Actually, the iOS browser decides it's doing a native scroll, so it cancels the `touchmove`. But wait, there was NO `touchcancel`!
|
||||
// What if iOS is using `pointermove` instead of `touchmove` entirely for the rest of the gesture?
|
||||
// YES! Pointer events are replacing Touch events in Safari for some logic!
|
||||
// Our `touchmove` handler was the only one syncing the scroll:
|
||||
// \`onTouchKeyboardTouchMove = (event: TouchEvent) => { ... }\`
|
||||
// We IGNORED pointermove!
|
||||
Reference in New Issue
Block a user