fix focus behavior on new page/popup
This commit is contained in:
parent
3cc70790bd
commit
ea39447708
2 changed files with 7 additions and 8 deletions
|
|
@ -10,7 +10,7 @@ Item {
|
|||
property StackView stackView: StackView.view
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible && !GC.isMobile()) {
|
||||
if (visible) {
|
||||
timer.start()
|
||||
}
|
||||
}
|
||||
|
|
@ -20,10 +20,11 @@ Item {
|
|||
id: timer
|
||||
interval: 200 // Milliseconds
|
||||
onTriggered: {
|
||||
console.debug(">>> PageType timer triggered")
|
||||
FocusController.resetRootObject()
|
||||
FocusController.setFocusOnDefaultItem()
|
||||
}
|
||||
repeat: false // Stop the timer after one trigger
|
||||
running: !GC.isMobile() // Start the timer
|
||||
running: true // Start the timer
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,15 +45,13 @@ Popup {
|
|||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: 400 // Milliseconds
|
||||
interval: 200 // Milliseconds
|
||||
onTriggered: {
|
||||
if (!GC.isMobile()) {
|
||||
FocusController.setFocusItem(closeButton)
|
||||
FocusController.pushRootObject(root)
|
||||
}
|
||||
FocusController.pushRootObject(root)
|
||||
FocusController.setFocusItem(closeButton)
|
||||
}
|
||||
repeat: false // Stop the timer after one trigger
|
||||
running: !GC.isMobile() // Start the timer
|
||||
running: true // Start the timer
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue