Skip to content

Commit

Permalink
Allow native double/triple tap behavior on mobile platforms
Browse files Browse the repository at this point in the history
FIX: Don't override double/triple tap behavior on touch screen devices, so
that the mobile selection menu pops up properly.

Issue codemirror/dev#935
  • Loading branch information
marijnh committed Sep 22, 2022
1 parent 3a9d768 commit 1b7d7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ handlerOptions.touchstart = handlerOptions.touchmove = {passive: true}

handlers.mousedown = (view, event: MouseEvent) => {
view.observer.flush()
if (view.inputState.lastTouchTime > Date.now() - 2000 && getClickType(event) == 1) return // Ignore touch interaction
if (view.inputState.lastTouchTime > Date.now() - 2000) return // Ignore touch interaction
let style: MouseSelectionStyle | null = null
for (let makeStyle of view.state.facet(mouseSelectionStyle)) {
style = makeStyle(view, event)
Expand Down

0 comments on commit 1b7d7f1

Please sign in to comment.