MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / omtouchmove

Function omtouchmove

src/components/tabView.js:122–139  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

120 }
121
122 function omtouchmove(e) {
123 const { clientX, clientY } = e.touches[0];
124 const deltaX = lastX - clientX;
125 const deltaY = lastY - clientY;
126
127 // Determine if the user is primarily scrolling vertically
128 if (!isScrolling) {
129 isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
130 }
131
132 if (!isScrolling) {
133 moveX += deltaX;
134 e.preventDefault();
135 }
136
137 lastX = clientX;
138 lastY = clientY;
139 }
140
141 function omtouchend() {
142 document.removeEventListener("touchmove", omtouchmove);

Callers

nothing calls this directly

Calls 1

preventDefaultMethod · 0.45

Tested by

no test coverage detected