From 68e9f06a13621f61c4b007fa74df1076ac1cb37a Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Thu, 11 Feb 2021 12:33:32 +0200 Subject: [PATCH] GridComicsView: ignore unhandled key presses When a key not handled by Grid view is pressed while it has focus, the following warning appears in Library's output qrc:/qml/GridComicsView.qml:776: Error: Cannot assign [undefined] to int AND the top-left cover is selected. The added early return fixes both issues. --- YACReaderLibrary/qml/GridComicsView.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/YACReaderLibrary/qml/GridComicsView.qml b/YACReaderLibrary/qml/GridComicsView.qml index 1df98bc9..f09e2049 100644 --- a/YACReaderLibrary/qml/GridComicsView.qml +++ b/YACReaderLibrary/qml/GridComicsView.qml @@ -806,6 +806,8 @@ Rectangle { } else if (event.key === Qt.Key_Down) { ci = Math.min(grid.currentIndex+numCells,grid.count - 1); + } else { + return; } event.accepted = true;