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: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "closed"
|
name: "closed"
|
||||||
|
@ -167,15 +167,27 @@ CommonDialog {
|
|||||||
reject()
|
reject()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: focusTimer
|
||||||
|
interval: 100
|
||||||
|
onTriggered: {
|
||||||
|
filterField.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
|
//FIXME: why needs focus deactivation then activation?
|
||||||
|
if (status == DialogStatus.Open) {
|
||||||
|
filterField.focus = false
|
||||||
|
focusTimer.running = true
|
||||||
|
}
|
||||||
|
|
||||||
if (status == DialogStatus.Opening) {
|
if (status == DialogStatus.Opening) {
|
||||||
if (listView.currentItem != null) {
|
if (listView.currentItem != null) {
|
||||||
listView.currentItem.focus = false
|
listView.currentItem.focus = false
|
||||||
}
|
}
|
||||||
listView.currentIndex = -1
|
listView.currentIndex = -1
|
||||||
listView.positionViewAtIndex(0, ListView.Beginning)
|
listView.positionViewAtIndex(0, ListView.Beginning)
|
||||||
}
|
} else if (status == DialogStatus.Open) {
|
||||||
else if (status == DialogStatus.Open) {
|
|
||||||
listView.focus = true
|
listView.focus = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user