Commit 691a8210 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(SearchBox): create `_filter` function

parent a1f33b42
......@@ -44,6 +44,18 @@ Item {
_isOpen = true
}
function _filter (text) {
console.assert(
model.setFilterFixedString != null,
'`model.setFilterFixedString` must be defined.'
)
model.setFilterFixedString(text)
if (model.invalidate) {
model.invalidate()
}
}
// -----------------------------------------------------------------
implicitHeight: searchField.height
......@@ -63,18 +75,7 @@ Item {
Keys.onEscapePressed: searchBox.hideMenu()
onActiveFocusChanged: activeFocus && searchBox.showMenu()
onTextChanged: {
console.assert(
model.setFilterFixedString != null,
'`model.setFilterFixedString` must be defined.'
)
model.setFilterFixedString(text)
if (model.invalidate) {
model.invalidate()
}
}
onTextChanged: _filter()
}
// Wrap the search box menu in a window.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment