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.
- package/dist/hooks/android-input-manager/android-input-manager.d.ts.map +1 -1
- package/dist/index.es.js +10 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/slate-react.js +12 -1
- package/dist/slate-react.min.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -242,6 +242,7 @@ function createAndroidInputManager(_ref) {
|
|
|
242
242
|
var flushTimeoutId = null;
|
|
243
243
|
var actionTimeoutId = null;
|
|
244
244
|
var lastCompositionActivity = 0;
|
|
245
|
+
var lastInsertText = 0;
|
|
245
246
|
var compositionCleared = false;
|
|
246
247
|
var hasUnrenderedMutations = false;
|
|
247
248
|
var idCounter = 0;
|
|
@@ -544,6 +545,10 @@ function createAndroidInputManager(_ref) {
|
|
|
544
545
|
}
|
|
545
546
|
var isNodeMapDirty = slateDom.IS_NODE_MAP_DIRTY.get(editor);
|
|
546
547
|
var type = event.inputType;
|
|
548
|
+
var continuesFirefoxInsert = slateDom.IS_FIREFOX && type === 'insertText' && Date.now() - lastInsertText < RESOLVE_DELAY;
|
|
549
|
+
if (type === 'insertText') {
|
|
550
|
+
lastInsertText = Date.now();
|
|
551
|
+
}
|
|
547
552
|
if (type === 'insertCompositionText' || type === 'deleteCompositionText') {
|
|
548
553
|
lastCompositionActivity = Date.now();
|
|
549
554
|
if (event.data) {
|
|
@@ -857,6 +862,12 @@ function createAndroidInputManager(_ref) {
|
|
|
857
862
|
if (slateDom.EDITOR_TO_PENDING_INSERTION_MARKS.get(editor)) {
|
|
858
863
|
_text = _text.replace("\uFEFF", '');
|
|
859
864
|
}
|
|
865
|
+
if (continuesFirefoxInsert && editor.selection && !slate.Range.equals(targetRange, editor.selection)) {
|
|
866
|
+
event.preventDefault();
|
|
867
|
+
return scheduleAction(function () {
|
|
868
|
+
return slate.Editor.insertText(editor, _text);
|
|
869
|
+
});
|
|
870
|
+
}
|
|
860
871
|
// Pastes from the Android clipboard will generate `insertText` events.
|
|
861
872
|
// If the copied text contains any newlines, Android will append an
|
|
862
873
|
// extra newline to the end of the copied text.
|