Prevent fullscreen keyboard from reacting when modals are shown
This commit is contained in:
parent
cbde677283
commit
5b6cd2d8b5
@ -26,6 +26,10 @@ class _FullscreenKeyboardListenerState extends State<FullscreenKeyboardListener>
|
|||||||
|
|
||||||
bool _handleKey(KeyEvent event) {
|
bool _handleKey(KeyEvent event) {
|
||||||
bool result = false;
|
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) {
|
if (event is KeyDownEvent && widget.onKeyDown != null) {
|
||||||
result = widget.onKeyDown!.call(event);
|
result = widget.onKeyDown!.call(event);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user