Fix IME issue when typing Vietnamese #2734
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Is this adding or improving a feature or fixing a bug?
This is the bug when typing Vietnamese with macOS IME. Please take a look at the following video:
When typing Vietnamese if the user finishes a word without whitespace or enter (no
onCompositionEnd
yet) and suddenly change the selection (onCompositionEnd
occurred) then no text was inserted, but the view still displays the text which causes that text to disappear if the user does other edit commands (text input, bold,...).Note: to type "tiếng Việt", turn on macOS
Telex
IME then type "tieesng Vieejt".What's the new behavior?
User can input Vietnamese using macOS IME like this:
How does this change work?
Based on @yunwuxin work (fixed the cursor when typing and flashing when IME on) I add one more command
insertText
whenonCompositionEnd
occurred to explicitly sync the text in the view with the editor state.Have you checked that...?
yarn test
.yarn lint
. (Fix errors withyarn prettier
.)yarn watch
.)Does this fix any issues or need any specific reviewers?
Based on the work of @yunwuxin in #2415