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
|
property StackView stackView: StackView.view
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible && !GC.isMobile()) {
|
if (visible) {
|
||||||
timer.start()
|
timer.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,10 +20,11 @@ Item {
|
||||||
id: timer
|
id: timer
|
||||||
interval: 200 // Milliseconds
|
interval: 200 // Milliseconds
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
console.debug(">>> PageType timer triggered")
|
||||||
FocusController.resetRootObject()
|
FocusController.resetRootObject()
|
||||||
FocusController.setFocusOnDefaultItem()
|
FocusController.setFocusOnDefaultItem()
|
||||||
}
|
}
|
||||||
repeat: false // Stop the timer after one trigger
|
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 {
|
Timer {
|
||||||
id: timer
|
id: timer
|
||||||
interval: 400 // Milliseconds
|
interval: 200 // Milliseconds
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!GC.isMobile()) {
|
FocusController.pushRootObject(root)
|
||||||
FocusController.setFocusItem(closeButton)
|
FocusController.setFocusItem(closeButton)
|
||||||
FocusController.pushRootObject(root)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
repeat: false // Stop the timer after one trigger
|
repeat: false // Stop the timer after one trigger
|
||||||
running: !GC.isMobile() // Start the timer
|
running: true // Start the timer
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue