Skip to content

Commit

Permalink
Disable scroll workaround in start-drag handler for Safari
Browse files Browse the repository at this point in the history
Issue #6246
  • Loading branch information
marijnh committed Apr 27, 2020
1 parent ad54953 commit 0b64369
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edit/mouse_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 0b64369

Please sign in to comment.