SUMMARY This was introduced on https://invent.kde.org/frameworks/kirigami/-/merge_requests/143. To make the Esc capture work, currently the focus has to be forced to the Overlay Sheet item. This happens after signal `onSheetOpenChanged` has been raised, so it overrides any previous focus the user code may have set also on this signal. Or at best there would be a race condition. TEST CASE PSEUDOCODE (cannot test it right now) Kirigami.OverlaySheet { onSheetOpenChanged: { if (sheetOpen) { myText.forceActiveFocus() // will be overriden } } QQC2.TextField { id: myText } } OBSERVED RESULT The internal Item does not gain focus EXPECTED RESULT The internal Item should gain focus
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/250
Git commit 0f2c4005715be3c0d61ab6c64e79ef742420e53e by Marco Martin. Committed on 09/03/2021 at 14:29. Pushed by mart into branch 'master'. turn contentItemParent into a FocusScope when forcing it to active focus, it should not steal the focus from any of its descendants, and a focusScope will have focus whenever any descendant has it, and won't ever steal it from them M +1 -1 src/controls/templates/OverlaySheet.qml https://invent.kde.org/frameworks/kirigami/commit/0f2c4005715be3c0d61ab6c64e79ef742420e53e