From 3733f52bcf3866f6795d6ac73fbf0592ab9dbf53 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sat, 31 Jan 2026 20:11:48 +0100 Subject: [PATCH] fix: manage libraries focus --- lib/screens/libraries/libraries_screen.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/screens/libraries/libraries_screen.dart b/lib/screens/libraries/libraries_screen.dart index 5e904614..d7c5d2c6 100644 --- a/lib/screens/libraries/libraries_screen.dart +++ b/lib/screens/libraries/libraries_screen.dart @@ -1370,6 +1370,7 @@ class _LibraryManagementSheetState extends State<_LibraryManagementSheet> { _movingIndex = _movingIndex! - 1; _focusedIndex = _movingIndex!; }); + _ensureFocusedVisible(); return KeyEventResult.handled; } if (key.isDownKey && _movingIndex! < _tempLibraries.length - 1) { @@ -1379,6 +1380,7 @@ class _LibraryManagementSheetState extends State<_LibraryManagementSheet> { _movingIndex = _movingIndex! + 1; _focusedIndex = _movingIndex!; }); + _ensureFocusedVisible(); return KeyEventResult.handled; } if (key.isSelectKey) { @@ -1438,6 +1440,11 @@ class _LibraryManagementSheetState extends State<_LibraryManagementSheet> { } } + // Block d-pad keys at boundaries so focus doesn't escape the dialog + if (key.isDpadDirection) { + return KeyEventResult.handled; + } + return KeyEventResult.ignored; }