initialstart/time: Fix search box getting unfocused on every key press

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/288

Ensure that the ListView is not taking focus from the text field
This commit is contained in:
Devin Lin 2024-03-08 17:34:10 -05:00
parent d2f63e6d9a
commit 7d4fdf48a5

View file

@ -68,6 +68,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
model: Time.TimeUtil.timeZones
currentIndex: -1 // ensure focus is not on the listview
header: Control {
width: listView.width
@ -81,14 +82,6 @@ Item {
onTextChanged: {
Time.TimeUtil.timeZones.filterString = text;
// HACK: search field seems to lose focus every time the text changes
focusTimer.restart();
}
Timer {
id: focusTimer
interval: 1
onTriggered: searchField.forceActiveFocus()
}
}
}