1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 12:41:44 +02:00

this.element might be null when the callback is executed (#1489)

This commit is contained in:
Stan Chang Khin Boon
2017-12-30 02:48:53 +08:00
committed by Ian Storm Taylor
parent 6f5f2db271
commit 02c4837d4c

View File

@@ -228,7 +228,7 @@ class Content extends React.Component {
setTimeout(() => { setTimeout(() => {
// COMPAT: In Firefox, it's not enough to create a range, you also need to // COMPAT: In Firefox, it's not enough to create a range, you also need to
// focus the contenteditable element too. (2016/11/16) // focus the contenteditable element too. (2016/11/16)
if (IS_FIREFOX) this.element.focus() if (IS_FIREFOX && this.element) this.element.focus()
this.tmp.isUpdatingSelection = false this.tmp.isUpdatingSelection = false
}) })