SUMMARY - Kirigami Overlay Drawers do not close when the escape key is pressed. explicitly adding the closePolicy does not seem to help either. - Escape Key and closePolicy only works when setting the interactive property explicitly to true in non mobile environment - Interactive property of the overlay drawer seems to be set to false by default on non mobile platforms or touch enabled platforms. STEPS TO REPRODUCE: Sample Code: - The overlay drawer has been given a closePolicy, but does not react to escape key press unless interactive property is set to true Kirigami.AbstractApplicationWindow { width: 640 height: 480 visible: true Button { anchors.bottom: parent.bottom width: parent.width height: Kirigami.Units.gridUnit * 2 text: "Open Drawer" onClicked: { exampleOverlayDrawer.open() } } Kirigami.OverlayDrawer { id: exampleOverlayDrawer width: parent.width height: parent.height * 0.5 edge: Qt.TopEdge closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside dim: true // if this property is not set to true explicitly on non mobile platforms closePolicy does not apply and escape key is not caught // interactive: true onOpened: { sampleButton.forceActiveFocus() } contentItem: Item { Button { id: sampleButton width: parent.width height: Kirigami.Units.gridUnit * 2 text: "Close Drawer" background: Rectangle { color: sampleButton.activeFocus ? Kirigami.Theme.highlightColor : "white" } onClicked: { exampleOverlayDrawer.close() } } } } } SOFTWARE/OS VERSIONS Distribution: KDE Neon KDE Plasma Version: 5.24.80 KDE Frameworks Version: 5.94.0 Qt Version: 5.15.3 Graphics Platform: X11
If I set interactive to true, it works as intended, but the Qt doc is implying that interactive sets touch gestures and not all gestures. https://doc.qt.io/qt-6/qml-qtquick-controls2-drawer.html#interactive-prop
I tested this on my laptop, and it works as intended when using the touchscreen.
Fixed by Matej Starc with https://invent.kde.org/frameworks/kirigami/-/commit/ffd5af1e55798d784d9a6100dfb43ce73d8912f4 in Frameworks 5.102!