Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/display/update_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { sawCollapsedSpans } from "../line/saw_special_spans.js"
import { heightAtLine, visualLineEndNo, visualLineNo } from "../line/spans.js"
import { getLine, lineNumberFor } from "../line/utils_line.js"
import { displayHeight, displayWidth, getDimensions, paddingVert, scrollGap } from "../measurement/position_measurement.js"
import { mac, webkit } from "../util/browser.js"
import { mac, webkit, chrome } from "../util/browser.js"
import { activeElt, removeChildren, contains } from "../util/dom.js"
import { hasHandler, signal } from "../util/event.js"
import { indexOf } from "../util/misc.js"
Expand Down Expand Up @@ -95,6 +95,11 @@ export function updateDisplayIfNeeded(cm, update) {
return false
}

// Bail out if there is a touch event in progress on chrome. Fixes https://github.com/codemirror/CodeMirror/issues/5844
if (chrome && cm.activeTouch !== null && !update.force) {
return false
}

// Bail out if the visible area is already rendered and nothing changed.
if (!update.force &&
update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
Expand Down