[SailfishDevel] SearchField and focus
Lucien XU
sfietkonstantin at free.fr
Thu Aug 8 15:13:18 UTC 2013
Le jeudi 8 août 2013 17:10:26 Benoît HERVIER a écrit :
> Hi,
>
> I'm trying to use SearchField to have a .... suspense ... a search
> field for my list view.
> So i try to filter in realtime ... and i notice that SearchField lose
> focus
>
> Basically, i do a reset on the ListModel and append data
>
> This could come from the use i made from SearchField, so here a snippet
> of the code :
>
> SilicaListView {
> id: notesView
> model: notesModel
> anchors.fill: parent
> header: Column {
> width: parent.width
> PageHeader {
> title: "ownNotes"
> }
> SearchField {
> id: searchField
> placeholderText: "Search"
> width: parent.width
> onTextChanged: {
> searchText = searchField.text;
> notesModel.applyFilter(searchText)
> }
>
> }
> }
> section {
> property: 'category'
> delegate: SectionHeader {
> text: section
> }
> }
>
> Any advices ?
I have the same issue. The searchfield got unfocused each time data is added
in a list view. That's not conveinent for an autocomplete field ...
No advices though, I'm trying to see what's wrong.
More information about the Devel
mailing list