1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 04:04:06 +02:00

Fix mouse refocus in IE 11 (#2535)

* Fix mouse focus in IE 11

In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes #2364

* Skip delect onFocus for EDGE
This commit is contained in:
Jason Staten
2019-01-29 17:11:18 -07:00
committed by Ian Storm Taylor
parent 1564c3a031
commit 83e45ac054

View File

@@ -3,7 +3,7 @@ import Debug from 'debug'
import Hotkeys from 'slate-hotkeys'
import Plain from 'slate-plain-serializer'
import getWindow from 'get-window'
import { IS_IOS } from 'slate-dev-environment'
import { IS_IOS, IS_IE, IS_EDGE } from 'slate-dev-environment'
import cloneFragment from '../utils/clone-fragment'
import findDOMNode from '../utils/find-dom-node'
@@ -392,7 +392,7 @@ function AfterPlugin(options = {}) {
// followed by a `selectionchange`, so we need to deselect here to prevent
// the old selection from being set by the `updateSelection` of `<Content>`,
// preventing the `selectionchange` from firing. (2018/11/07)
if (isMouseDown) {
if (isMouseDown && !IS_IE && !IS_EDGE) {
editor.deselect().focus()
} else {
editor.focus()