slate-react 0.145.0 → 0.145.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4379,7 +4379,12 @@ var Editable = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
4379
4379
  }
4380
4380
  if (ReactEditor.hasTarget(editor, event.target) && !isEventHandled(event, attributes.onClick) && slateDom.isDOMNode(event.target)) {
4381
4381
  var node = ReactEditor.toSlateNode(editor, event.target);
4382
- var path = ReactEditor.findPath(editor, node);
4382
+ var path;
4383
+ try {
4384
+ path = ReactEditor.findPath(editor, node);
4385
+ } catch (_unused) {
4386
+ return;
4387
+ }
4383
4388
  // At this time, the Slate document may be arbitrarily different,
4384
4389
  // because onClick handlers can change the document before we get here.
4385
4390
  // Therefore we must check that this path actually exists,