1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-07 15:56:35 +02:00

Fix editor.insertText never gets called inside plugins on Android (#4753)

* Call Editor.insertText instead of Transforms.insertText to allow overriding by plugins

* Use Editor.insertText in android-input-manager

* changeset
This commit is contained in:
Alessio Galdy
2022-01-04 14:10:35 +01:00
committed by GitHub
parent 735d2d047a
commit e9a46ad29e
4 changed files with 8 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fix "editor.insertText never gets called inside plugins on android"

View File

@@ -560,9 +560,7 @@ export const AndroidEditable = (props: EditableProps): JSX.Element => {
}) })
editor.marks = null editor.marks = null
} else { } else {
Transforms.insertText(editor, text, { Editor.insertText(editor, text)
at,
})
} }
}) })
}, RESOLVE_DELAY) }, RESOLVE_DELAY)

View File

@@ -134,9 +134,7 @@ export class AndroidInputManager {
}) })
this.editor.marks = null this.editor.marks = null
} else { } else {
Transforms.insertText(this.editor, text, { Editor.insertText(this.editor, text)
at,
})
} }
}) })
} }

View File

@@ -793,7 +793,7 @@ export const Editable = (props: EditableProps) => {
distance: currentTextNode.text.length, distance: currentTextNode.text.length,
reverse: true, reverse: true,
}) })
Transforms.insertText(editor, text) Editor.insertText(editor, text)
}) })
} }
} }