mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-01 05:16:10 +01:00
Avoid crash in updateSelection() in content when window.getSelection() returns null (#2163)
This commit is contained in:
parent
dbf35f2565
commit
222f746e85
@ -144,6 +144,11 @@ class Content extends React.Component {
|
||||
const { isBackward } = selection
|
||||
const window = getWindow(this.element)
|
||||
const native = window.getSelection()
|
||||
|
||||
// .getSelection() can return null in some cases
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=827585
|
||||
if (!native) return
|
||||
|
||||
const { rangeCount, anchorNode } = native
|
||||
|
||||
// If both selections are blurred, do nothing.
|
||||
|
Loading…
x
Reference in New Issue
Block a user