Tie modal loader to shouldBeVisible

This commit is contained in:
bbedward committed 2025-09-30 11:01:51 -04:00
1 parent 02c4ac1bc7
commit 91aba84c29
1 file changed
+4 -4
+4 -4
View File
@@ -172,7 +172,7 @@ PanelWindow {
id: contentLoader
anchors.fill: parent
active: root.visible
active: root.shouldBeVisible
asynchronous: false
}
@@ -207,8 +207,8 @@ PanelWindow {
objectName: "modalFocusScope"
anchors.fill: parent
visible: root.visible // Only active when the modal is visible
focus: root.visible
visible: root.shouldBeVisible
focus: root.shouldBeVisible
Keys.onEscapePressed: event => {
if (root.closeOnEscapeKey && shouldHaveFocus) {
root.close()
@@ -223,7 +223,7 @@ PanelWindow {
Connections {
function onShouldHaveFocusChanged() {
if (shouldHaveFocus && visible) {
if (shouldHaveFocus && shouldBeVisible) {
Qt.callLater(() => focusScope.forceActiveFocus())
}
}