mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
Aggresive focus restoration
This commit is contained in:
@@ -90,6 +90,11 @@ DankModal {
|
|||||||
parentModal.shouldHaveFocus = Qt.binding(() => {
|
parentModal.shouldHaveFocus = Qt.binding(() => {
|
||||||
return parentModal.shouldBeVisible
|
return parentModal.shouldBeVisible
|
||||||
})
|
})
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (parentModal && parentModal.modalFocusScope) {
|
||||||
|
parentModal.modalFocusScope.forceActiveFocus()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +110,16 @@ DankModal {
|
|||||||
filteredWidgets = []
|
filteredWidgets = []
|
||||||
selectedIndex = -1
|
selectedIndex = -1
|
||||||
keyboardNavigationActive = false
|
keyboardNavigationActive = false
|
||||||
|
if (parentModal) {
|
||||||
|
parentModal.shouldHaveFocus = Qt.binding(() => {
|
||||||
|
return parentModal.shouldBeVisible
|
||||||
|
})
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (parentModal && parentModal.modalFocusScope) {
|
||||||
|
parentModal.modalFocusScope.forceActiveFocus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onBackgroundClicked: () => {
|
onBackgroundClicked: () => {
|
||||||
return hide()
|
return hide()
|
||||||
|
|||||||
Reference in New Issue
Block a user