From 5b6cd2d8b57246f8a42d50141f42fbbcdf0fbafd Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 5 Dec 2023 10:55:24 -0700 Subject: [PATCH] Prevent fullscreen keyboard from reacting when modals are shown --- lib/ui/common/fullscreen_keyboard_listener.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ui/common/fullscreen_keyboard_listener.dart b/lib/ui/common/fullscreen_keyboard_listener.dart index 55620781..979e452d 100644 --- a/lib/ui/common/fullscreen_keyboard_listener.dart +++ b/lib/ui/common/fullscreen_keyboard_listener.dart @@ -26,6 +26,10 @@ class _FullscreenKeyboardListenerState extends State bool _handleKey(KeyEvent event) { bool result = false; + + /// Exit early if we are not the current;y focused route (dialog on top?) + if (ModalRoute.of(context)?.isCurrent == false) return false; + if (event is KeyDownEvent && widget.onKeyDown != null) { result = widget.onKeyDown!.call(event); }