fix: dpad number input

close #196
This commit is contained in:
edde746
2026-01-24 17:41:12 +01:00
parent e11c7e3eed
commit f5dc67573c
2 changed files with 25 additions and 1 deletions
+5 -1
View File
@@ -970,6 +970,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
required Future<void> Function(int value) onSave,
}) {
int spinnerValue = currentValue;
final saveFocusNode = FocusNode();
showDialog(
context: context,
@@ -992,6 +993,8 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
spinnerValue = value;
});
},
onConfirm: () => saveFocusNode.requestFocus(),
onCancel: () => Navigator.pop(dialogContext),
),
const SizedBox(height: 8),
Text(
@@ -1005,6 +1008,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
actions: [
TextButton(onPressed: () => Navigator.pop(dialogContext), child: Text(t.common.cancel)),
TextButton(
focusNode: saveFocusNode,
onPressed: () async {
await onSave(spinnerValue);
if (dialogContext.mounted) {
@@ -1018,7 +1022,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
},
);
},
);
).then((_) => saveFocusNode.dispose());
}
/// Standard numeric input dialog with TextField for non-TV platforms.