Prevent default Press but not default Drag in iOS MobileSafari?

前端 未结 2 1524
不思量自难忘°
不思量自难忘° 2020-12-28 20:45

Context: Web app on MobileSafari/iPad, both full-screen and embedded in iframe

Goal: Technique that provides custom event handlers

2条回答
  •  梦毁少年i
    2020-12-28 21:03

    Ugly Possibility: Don't prevent a press - make a default press do nothing. Try to use a glass-pane div that catches all touches and doesn't prevent anything on touchstart.

    Divs do have default Press behavior (some kind of selection), but perhaps that can be turned off, not via preventDevault but via ? ref

    This would mean we'd have to do our own hit-testing to determine what DOM nodes to pass our recognized events to, since we can't just let events bubble up the DOM ancestor chain.

提交回复
热议问题