slate-react 0.91.6 → 0.91.7

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
@@ -4197,6 +4197,8 @@ var Editable = function Editable(props) {
4197
4197
  }, [readOnly, propsOnDOMBeforeInput]);
4198
4198
  var callbackRef = React.useCallback(function (node) {
4199
4199
  if (node == null) {
4200
+ onDOMSelectionChange.cancel();
4201
+ scheduleOnDOMSelectionChange.cancel();
4200
4202
  EDITOR_TO_ELEMENT["delete"](editor);
4201
4203
  NODE_TO_ELEMENT["delete"](editor);
4202
4204
 
@@ -4216,7 +4218,7 @@ var Editable = function Editable(props) {
4216
4218
  }
4217
4219
 
4218
4220
  ref.current = node;
4219
- }, [ref, onDOMBeforeInput]); // Attach a native DOM event handler for `selectionchange`, because React's
4221
+ }, [ref, onDOMBeforeInput, onDOMSelectionChange, scheduleOnDOMSelectionChange]); // Attach a native DOM event handler for `selectionchange`, because React's
4220
4222
  // built-in `onSelect` handler doesn't fire for all selection changes. It's a
4221
4223
  // leaky polyfill that only fires on keypresses or clicks. Instead, we want to
4222
4224
  // fire for any change to the selection inside the editor. (2019/11/04)