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; }