feat(StatusSearchPopup): introduce forceActiveFocus API

This is used to enforce focus on the search input when the popup
is opened. In fact users decide to override the search popup's
`onOpened` handler, they still get access to this API to make use of it.
This commit is contained in:
Pascal Precht 2021-09-08 11:00:42 +02:00 committed by Michał Cieślak
parent 7bd484c339
commit 782c0eecfe
1 changed files with 9 additions and 0 deletions

View File

@ -51,10 +51,19 @@ StatusModal {
setSearchSelection(defaultSearchLocationText, "", "", false, "", "transparent")
}
function forceActiveFocus() {
contentItem.searchInput.forceActiveFocus()
}
onOpened: {
forceActiveFocus();
}
contentItem: Item {
width: parent.width
height: root.height
property alias searchText: inputText.text
property alias searchInput: inputText
ColumnLayout {
id: contentItemColumn