Skip to content

Commit

Permalink
Fix ios chrome ime double input issue. (#4049)
Browse files Browse the repository at this point in the history
* Fix ios chrome ime double input issue.

* add changeset

* pretty fix.

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

Thanks @ulion!
  • Loading branch information
ulion authored Aug 6, 2021
1 parent 2614dc3 commit 6c84422
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/metal-trees-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'slate-react': patch
'slate': patch
---

Fix ios chrome ime double input issue.
3 changes: 2 additions & 1 deletion packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 6c84422

Please sign in to comment.