Browse Source
Android - Reset android input method focus and connection state when text input focus is removed (#19083)
* reset android input method focus and connection state when text input focus is removed
* addresses comment
pull/19096/head
Emmanuel Hansen
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
0 deletions
-
src/Android/Avalonia.Android/Platform/Input/AndroidInputMethod.cs
|
|
@ -89,6 +89,9 @@ namespace Avalonia.Android.Platform.Input |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
_host.ClearFocus(); |
|
|
|
|
|
_imm.RestartInput(View); |
|
|
|
|
|
_inputConnection = null; |
|
|
_imm.HideSoftInputFromWindow(_host.WindowToken, HideSoftInputFlags.ImplicitOnly); |
|
|
_imm.HideSoftInputFromWindow(_host.WindowToken, HideSoftInputFlags.ImplicitOnly); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -149,7 +152,9 @@ namespace Avalonia.Android.Platform.Input |
|
|
_host.InitEditorInfo((topLevel, outAttrs) => |
|
|
_host.InitEditorInfo((topLevel, outAttrs) => |
|
|
{ |
|
|
{ |
|
|
if (_client == null) |
|
|
if (_client == null) |
|
|
|
|
|
{ |
|
|
return null!; |
|
|
return null!; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
_inputConnection = new AvaloniaInputConnection(topLevel, this); |
|
|
_inputConnection = new AvaloniaInputConnection(topLevel, this); |
|
|
|
|
|
|
|
|
|