slate-react 0.91.5 → 0.91.6

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.
@@ -3671,21 +3671,24 @@
3671
3671
  };
3672
3672
 
3673
3673
  function restoreDOM() {
3674
- bufferedMutations.reverse().forEach(function (mutation) {
3675
- if (mutation.type === 'characterData') {
3676
- mutation.target.textContent = mutation.oldValue;
3677
- return;
3678
- }
3674
+ if (bufferedMutations.length > 0) {
3675
+ bufferedMutations.reverse().forEach(function (mutation) {
3676
+ if (mutation.type === 'characterData') {
3677
+ // We don't want to restore the DOM for characterData mutations
3678
+ // because this interrupts the composition.
3679
+ return;
3680
+ }
3679
3681
 
3680
- mutation.removedNodes.forEach(function (node) {
3681
- mutation.target.insertBefore(node, mutation.nextSibling);
3682
- });
3683
- mutation.addedNodes.forEach(function (node) {
3684
- mutation.target.removeChild(node);
3685
- });
3686
- }); // Clear buffered mutations to ensure we don't undo them twice
3682
+ mutation.removedNodes.forEach(function (node) {
3683
+ mutation.target.insertBefore(node, mutation.nextSibling);
3684
+ });
3685
+ mutation.addedNodes.forEach(function (node) {
3686
+ mutation.target.removeChild(node);
3687
+ });
3688
+ }); // Clear buffered mutations to ensure we don't undo them twice
3687
3689
 
3688
- clear();
3690
+ clear();
3691
+ }
3689
3692
  }
3690
3693
 
3691
3694
  return {
@@ -5749,6 +5752,10 @@
5749
5752
  }
5750
5753
  }, [readOnly]),
5751
5754
  onInput: React.useCallback(function (event) {
5755
+ if (isEventHandled(event, attributes.onInput)) {
5756
+ return;
5757
+ }
5758
+
5752
5759
  if (androidInputManager) {
5753
5760
  androidInputManager.handleInput();
5754
5761
  return;