Fix composition logic for Firefox#106873
Fix composition logic for Firefox#106873rebornix merged 3 commits intomicrosoft:masterfrom belcherj:patch-1
Conversation
Fixes: #106392 In Firefox when inserting Emoji's using the macOS emoji input or using the compositor for characters with accents è, ë, î, etc. the character is inserted twice. Additionally, when adding an accented character the base character was also inserted. Examples: 🏅 inserts 🏅🏅 è inserts eèè This change does two things: - It removes `this._onType.fire(typeInput);` from the compositionupdate event listener. If you are in the middle of a composition there is no need to fire off the event. This change fixes the unaccented character from being inserted. `è` no longer inserts `eè`. - In the composition end function `browser.isFirefox` is added to the conditional that resets this._textAreaState to the value of the text area. This is needed as the insert of the composition is handled by L294. The textarea needs to be updated correctly when the compositions ends. Tested in Firefox (Windows 10, Ubuntu, macOS), Safari (macOS), Chrome (macOS), Edge Legacy (Windows 10), Edge (Windows 10)
textInput is no longer used. This removes the declaration as it is not used or needed.
|
Just a reminder, for changes in this area we need to go through all the input modes documented at https://github.com/microsoft/vscode/wiki/IME-Test @rebornix Could you please also help to test this? I think removing |
|
Alex, thank you for taking a look. I will work through the tests in that doc as well. |
|
I gave it a test on macOS and found it changed the behavior of Japanese IME in both Safari and Firefox, meaning that removing One example:
|
|
I'll take a closer look at why this breaks CJK in October, thanks for your help @belcherj ! |
|
Tested that |
Fixes: #106392
In Firefox when inserting Emoji's using the macOS emoji input or using the compositor for characters with accents è, ë, î, etc. the character is inserted twice. Additionally, when adding an accented character the base character was also inserted.
Examples:
🏅 inserts 🏅🏅
è inserts eèè
This change does two things:
It removes
this._onType.fire(typeInput);from the compositionupdate event listener. If you are in the middle of a composition there is no need to fire off the event. This change fixes the unaccented character from being inserted.èno longer insertseè.In the composition end function
browser.isFirefoxis added to the conditional that resets this._textAreaState to the value of the text area. This is needed as the insert of the composition is handled by L294. The textarea needs to be updated correctly when the compositions ends.Tested in Firefox (Windows 10, Ubuntu, macOS), Safari (macOS), Chrome (macOS), Edge Legacy (Windows 10), Edge (Windows 10)
This PR fixes #