HTML5Window: call blur() before removing the compositionend listener (references openfl/openfl#2564)

This ensures that incomplete IME input gets committed
This commit is contained in:
Josh Tynjala
2023-01-11 12:49:49 -08:00
parent 4c81de5383
commit 26c6930c41

View File

@@ -1167,6 +1167,10 @@ class HTML5Window
{
if (textInput != null)
{
// call blur() before removing the compositionend listener
// to ensure that incomplete IME input is committed
textInput.blur();
textInput.removeEventListener('input', handleInputEvent, true);
textInput.removeEventListener('blur', handleFocusEvent, true);
textInput.removeEventListener('cut', handleCutOrCopyEvent, true);
@@ -1175,7 +1179,6 @@ class HTML5Window
textInput.removeEventListener('compositionstart', handleCompositionstartEvent, true);
textInput.removeEventListener('compositionend', handleCompositionendEvent, true);
textInput.blur();
}
}