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.
package/dist/index.js CHANGED
@@ -2263,21 +2263,24 @@ var createRestoreDomManager = function createRestoreDomManager(editor, receivedU
2263
2263
  };
2264
2264
 
2265
2265
  function restoreDOM() {
2266
- bufferedMutations.reverse().forEach(function (mutation) {
2267
- if (mutation.type === 'characterData') {
2268
- mutation.target.textContent = mutation.oldValue;
2269
- return;
2270
- }
2266
+ if (bufferedMutations.length > 0) {
2267
+ bufferedMutations.reverse().forEach(function (mutation) {
2268
+ if (mutation.type === 'characterData') {
2269
+ // We don't want to restore the DOM for characterData mutations
2270
+ // because this interrupts the composition.
2271
+ return;
2272
+ }
2271
2273
 
2272
- mutation.removedNodes.forEach(function (node) {
2273
- mutation.target.insertBefore(node, mutation.nextSibling);
2274
- });
2275
- mutation.addedNodes.forEach(function (node) {
2276
- mutation.target.removeChild(node);
2277
- });
2278
- }); // Clear buffered mutations to ensure we don't undo them twice
2274
+ mutation.removedNodes.forEach(function (node) {
2275
+ mutation.target.insertBefore(node, mutation.nextSibling);
2276
+ });
2277
+ mutation.addedNodes.forEach(function (node) {
2278
+ mutation.target.removeChild(node);
2279
+ });
2280
+ }); // Clear buffered mutations to ensure we don't undo them twice
2279
2281
 
2280
- clear();
2282
+ clear();
2283
+ }
2281
2284
  }
2282
2285
 
2283
2286
  return {
@@ -4341,6 +4344,10 @@ var Editable = function Editable(props) {
4341
4344
  }
4342
4345
  }, [readOnly]),
4343
4346
  onInput: React.useCallback(function (event) {
4347
+ if (isEventHandled(event, attributes.onInput)) {
4348
+ return;
4349
+ }
4350
+
4344
4351
  if (androidInputManager) {
4345
4352
  androidInputManager.handleInput();
4346
4353
  return;