1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-21 13:49:44 +01:00

Fix ios chrome ime double input issue. (#4049)

* Fix ios chrome ime double input issue.

* add changeset

* pretty fix.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

Thanks @ulion!
This commit is contained in:
Ulion 2021-08-06 11:58:46 +08:00 committed by GitHub
parent 2614dc3c46
commit 6c84422721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
'slate-react': patch
'slate': patch
---
Fix ios chrome ime double input issue.

View File

@ -17,6 +17,7 @@ import useChildren from '../hooks/use-children'
import Hotkeys from '../utils/hotkeys'
import {
HAS_BEFORE_INPUT_SUPPORT,
IS_IOS,
IS_CHROME,
IS_FIREFOX,
IS_FIREFOX_LEGACY,
@ -659,7 +660,7 @@ export const Editable = (props: EditableProps) => {
// aren't correct and never fire the "insertFromComposition"
// type that we need. So instead, insert whenever a composition
// ends since it will already have been committed to the DOM.
if (!IS_SAFARI && !IS_FIREFOX_LEGACY && event.data) {
if (!IS_SAFARI && !IS_FIREFOX_LEGACY && !IS_IOS && event.data) {
Editor.insertText(editor, event.data)
}
}