fix: input mobile -> Android (#9767)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-11-08 12:11:56 +08:00
committed by GitHub
parent 0f070b0108
commit 7978e0301d
3 changed files with 25 additions and 11 deletions

View File

@@ -560,6 +560,14 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
controller: _textController,
// trick way to make backspace work always
keyboardType: TextInputType.multiline,
// `onChanged` may be called depending on the input method if this widget is wrapped in
// `Focus(onKeyEvent: ..., child: ...)`
// For `Backspace` button in the soft keyboard:
// en/fr input method:
// 1. The button will not trigger `onKeyEvent` if the text field is not empty.
// 2. The button will trigger `onKeyEvent` if the text field is empty.
// ko/zh/ja input method: the button will trigger `onKeyEvent`
// and the event will not popup if `KeyEventResult.handled` is returned.
onChanged: handleSoftKeyboardInput,
),
),