mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 13:11:17 +02:00
Fix an occasional crash in Firefox in isInEditor (#2229)
* Fix an occasional crash in Firefox in isInEditor * Update content.js
This commit is contained in:
committed by
Ian Storm Taylor
parent
10e8ab4db6
commit
1ff050265b
@@ -270,6 +270,12 @@ class Content extends React.Component {
|
|||||||
let el
|
let el
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// COMPAT: In Firefox, sometimes the node can be comment which doesn't
|
||||||
|
// have .closest and it crashes.
|
||||||
|
if (target.nodeType === 8) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// COMPAT: Text nodes don't have `isContentEditable` property. So, when
|
// COMPAT: Text nodes don't have `isContentEditable` property. So, when
|
||||||
// `target` is a text node use its parent node for check.
|
// `target` is a text node use its parent node for check.
|
||||||
el = target.nodeType === 3 ? target.parentNode : target
|
el = target.nodeType === 3 ? target.parentNode : target
|
||||||
|
Reference in New Issue
Block a user