How should web apps handle touch on touchscreen Macs?

November 17, 2026 5 answers
Asked by Nuvet

I'm thinking about touch support for a web app with drawing and dragging. In Sidecar testing, Safari seems to report mouse input rather than touch, while Chrome appears to provide scrolling but not the input needed for custom gestures. How would you handle this without breaking mouse and keyboard use?

Answers

_b63!claypocket.4

I'd start with Pointer Events for drawing and dragging rather than maintaining separate mouse and touch implementations. Handle pointerdown, pointermove, pointerup and pointercancel, and use setPointerCapture so a drag can continue when the pointer leaves the element.

For a drawing surface, touch-action: none tells the browser not to handle touch gestures there as scrolling or zooming. Scope that carefully so normal page scrolling still works elsewhere. Also make controls large enough to hit with a finger.

That only helps if the browser actually delivers usable pointer events. If Sidecar reports a touch as a mouse, pointerType won't reliably distinguish it from a physical mouse. If Chrome only exposes scrolling in that setup, the app can't reconstruct a drawing gesture from that alone.

Nuvet:

That distinction helps. The main goal is to keep mouse and keyboard behavior intact, with touch as an enhancement rather than a replacement.

Reply to this answer
_x54+plovercrank.2

I wouldn't assume Sidecar behavior tells you exactly what a touchscreen Mac will do. Test the actual browsers and hardware when they're available, especially the gestures your app depends on. Tablet support is useful, but it doesn't prove the same event stream will reach a browser on macOS.

Reply to this answer
6p~veldrik_294

For now, keep the existing desktop interaction solid and avoid building a bunch of heuristics around scroll events or mouse button values. Those guesses could break ordinary mouse input. If the browser doesn't expose enough information for a gesture, leave that feature unsupported for that input path rather than pretending it works.

Reply to this answer
_w56~gasketmural.8

There's also the mixed-device question. A browser window could be used with a mouse, trackpad or touchscreen, and might move between displays. I wouldn't switch the whole interface into a touch mode based on the device name. Generous hit targets and interactions that work with multiple inputs are a safer starting point.

6n~plovercaper_539:

And if touch is reported as mouse input, an app may not have enough information to make that switch accurately anyway.

Reply to this answer
3h+velourladle_592

How much effort this gets depends on the app. Touching an upright laptop screen can be tiring, but some people still prefer touch, especially for direct manipulation. I'd prioritize the interactions where it adds something useful rather than redesigning every desktop control around it.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions