1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-15 10:52:34 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
} else {
Transforms.insertText(editor, text, {
at,
})
Editor.insertText(editor, text)
}
})
}, RESOLVE_DELAY)

View File

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

View File

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