From 0b64369b54503150f054abda50359c76f00f484f Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 27 Apr 2020 13:45:54 +0200 Subject: [PATCH] Disable scroll workaround in start-drag handler for Safari Issue #6246 --- src/edit/mouse_events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/edit/mouse_events.js b/src/edit/mouse_events.js index 5d2899dd82..5fcc437021 100644 --- a/src/edit/mouse_events.js +++ b/src/edit/mouse_events.js @@ -7,7 +7,7 @@ import { posFromMouse } from "../measurement/position_measurement.js" import { eventInWidget } from "../measurement/widgets.js" import { normalizeSelection, Range, Selection } from "../model/selection.js" import { extendRange, extendSelection, replaceOneSelection, setSelection } from "../model/selection_updates.js" -import { captureRightClick, chromeOS, ie, ie_version, mac, webkit } from "../util/browser.js" +import { captureRightClick, chromeOS, ie, ie_version, mac, webkit, safari } from "../util/browser.js" import { getOrder, getBidiPartAt } from "../util/bidi.js" import { activeElt } from "../util/dom.js" import { e_button, e_defaultPrevented, e_preventDefault, e_target, hasHandler, off, on, signal, signalDOMEvent } from "../util/event.js" @@ -158,7 +158,7 @@ function leftButtonStartDrag(cm, event, pos, behavior) { if (!behavior.addNew) extendSelection(cm.doc, pos, null, null, behavior.extend) // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if (webkit || ie && ie_version == 9) + if ((webkit && !safari) || ie && ie_version == 9) setTimeout(() => {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus()}, 20) else display.input.focus()