Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing with Korean cannot be display properly in IE11 #350

Open
sohee-lee7 opened this issue Mar 6, 2019 · 1 comment
Open

Typing with Korean cannot be display properly in IE11 #350

sohee-lee7 opened this issue Mar 6, 2019 · 1 comment

Comments

@sohee-lee7
Copy link

sohee-lee7 commented Mar 6, 2019

When I input using Korea in IE11, typing can't be display properly.

screen recording 2019-03-06 at 5 24 57 pm mov

When typing using Korea in IE, the typing text is selected and collapsed of range is also false.
In this situation, Squire determines that one letter is selected and then remove the letter. In fact, the situation is in composition.

In this code, checking whether would perform the deletion logic.
https://github.com/neilj/Squire/blob/43b2c6b0e17a7fa1ce5b66c4fad326f3008a0846/source/KeyHandlers.js#L63-L73

Before this commit (b0ac7d3), key is empty string so the deletion logic was not performed.
But checking event.key occur this issue because IE does not support event.key. (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Browser_compatibility)
In IE, the value of event.key is not undefined but is wrong value. So the length of event.key is 1 and the deletion logic performed. In additional, event.isComposing is not supported in IE.

I think before checking the length of event.key, need to check isIE.

@sohee-lee7
Copy link
Author

sohee-lee7 commented Mar 6, 2019

When I test with checking isIE, typing Korean works well in IE.

--- a/source/KeyHandlers.js
+++ b/source/KeyHandlers.js
@@ -62,7 +62,7 @@ var onKey = function ( event ) {
     // !event.isComposing stops us from blatting Kana-Kanji conversion in Safari
     } else if ( !range.collapsed && !event.isComposing &&
             !event.ctrlKey && !event.metaKey &&
-            ( event.key || key ).length === 1 ) {
+            (isIE ? key : event.key || key).length === 1) {

But, I think this is not perfect solution. For more perfect, need to consider composition state or something for composition.
I wonder why this commit(b0ac7d3) was included and what problems there were.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant