You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I input using Korea in IE11, typing can't be display properly.
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.
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.
The text was updated successfully, but these errors were encountered:
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.
When I input using Korea in IE11, typing can't be display properly.
When typing using Korea in IE, the typing text is selected and
collapsed
of range is alsofalse
.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 supportevent.key
. (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Browser_compatibility)In IE, the value of
event.key
is notundefined
but is wrong value. So the length ofevent.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 checkisIE
.The text was updated successfully, but these errors were encountered: