ensure the text field has focus
This commit is contained in:
parent
7a656708fe
commit
6d4ad45c84
@ -168,10 +168,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
rootItem = Utils.rootObject()
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "closed"
|
||||
|
@ -167,15 +167,27 @@ CommonDialog {
|
||||
reject()
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: focusTimer
|
||||
interval: 100
|
||||
onTriggered: {
|
||||
filterField.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
onStatusChanged: {
|
||||
//FIXME: why needs focus deactivation then activation?
|
||||
if (status == DialogStatus.Open) {
|
||||
filterField.focus = false
|
||||
focusTimer.running = true
|
||||
}
|
||||
|
||||
if (status == DialogStatus.Opening) {
|
||||
if (listView.currentItem != null) {
|
||||
listView.currentItem.focus = false
|
||||
}
|
||||
listView.currentIndex = -1
|
||||
listView.positionViewAtIndex(0, ListView.Beginning)
|
||||
}
|
||||
else if (status == DialogStatus.Open) {
|
||||
} else if (status == DialogStatus.Open) {
|
||||
listView.focus = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user