mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-01 05:16:10 +01: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:
parent
10e8ab4db6
commit
1ff050265b
@ -270,6 +270,12 @@ class Content extends React.Component {
|
||||
let el
|
||||
|
||||
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
|
||||
// `target` is a text node use its parent node for check.
|
||||
el = target.nodeType === 3 ? target.parentNode : target
|
||||
|
Loading…
x
Reference in New Issue
Block a user