slate-react 0.147.2 → 0.147.3

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.
@@ -2018,7 +2018,7 @@
2018
2018
  offset--;
2019
2019
  }
2020
2020
  }
2021
- if (IS_ANDROID && !textNode && !exactMatch) {
2021
+ if (IS_ANDROID && parentNode && !textNode && !exactMatch) {
2022
2022
  const node = parentNode.hasAttribute('data-slate-node') ? parentNode : parentNode.closest('[data-slate-node]');
2023
2023
  if (node && DOMEditor.hasDOMNode(editor, node, {
2024
2024
  editable: true
@@ -3872,6 +3872,7 @@
3872
3872
  var flushTimeoutId = null;
3873
3873
  var actionTimeoutId = null;
3874
3874
  var lastCompositionActivity = 0;
3875
+ var lastInsertText = 0;
3875
3876
  var compositionCleared = false;
3876
3877
  var hasUnrenderedMutations = false;
3877
3878
  var idCounter = 0;
@@ -4174,6 +4175,10 @@
4174
4175
  }
4175
4176
  var isNodeMapDirty = IS_NODE_MAP_DIRTY.get(editor);
4176
4177
  var type = event.inputType;
4178
+ var continuesFirefoxInsert = IS_FIREFOX && type === 'insertText' && Date.now() - lastInsertText < RESOLVE_DELAY;
4179
+ if (type === 'insertText') {
4180
+ lastInsertText = Date.now();
4181
+ }
4177
4182
  if (type === 'insertCompositionText' || type === 'deleteCompositionText') {
4178
4183
  lastCompositionActivity = Date.now();
4179
4184
  if (event.data) {
@@ -4487,6 +4492,12 @@
4487
4492
  if (EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)) {
4488
4493
  _text = _text.replace("\uFEFF", '');
4489
4494
  }
4495
+ if (continuesFirefoxInsert && editor.selection && !slate.Range.equals(targetRange, editor.selection)) {
4496
+ event.preventDefault();
4497
+ return scheduleAction(function () {
4498
+ return slate.Editor.insertText(editor, _text);
4499
+ });
4500
+ }
4490
4501
  // Pastes from the Android clipboard will generate `insertText` events.
4491
4502
  // If the copied text contains any newlines, Android will append an
4492
4503
  // extra newline to the end of the copied text.