Skip to content

Commit

Permalink
Abort mouse selection on typing
Browse files Browse the repository at this point in the history
FIX: Stop mouse selection when the user types.

Closes codemirror/dev#1386
  • Loading branch information
marijnh committed May 30, 2024
1 parent ae1745d commit 639fd4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,10 @@ class MouseSelection {
}

update(update: ViewUpdate) {
if (this.style.update(update)) setTimeout(() => this.select(this.lastEvent), 20)
if (update.transactions.some(tr => tr.isUserEvent("input.type")))
this.destroy()
else if (this.style.update(update))
setTimeout(() => this.select(this.lastEvent), 20)
}
}

Expand Down

0 comments on commit 639fd4d

Please sign in to comment.