We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2019-01-27 14:05:17 +0200

force active Focus

My app uses a SearchField or TextArea in combination with SilicaListView similar to the search example in the component gallery, that is available as a sample project whithin the Sailfish SDK.

Currently I'm struggling with forcing the active focus of the SearchField or TextArea after the user has clicked on a ListItem. For any reasons, this is only possible after a second click respectively tap on the ListItem I have added an onClicked block in the delegate:

delegate: BackgroundItem {
    id: backgroundItem
    onClicked: {
        console.log("Force focus")
        searchField.forceActiveFocus()
    }
    ...
}

I played around with some approaches like Connections, but I couldn't find a solution, yet. Some ideas?

force active Focus

My app uses a SearchField or TextArea in combination with SilicaListView similar to the search example in the component gallery, that is available as a sample project whithin the Sailfish SDK.

Currently I'm struggling with forcing the active focus of the SearchField or TextArea after the user has clicked on a ListItem. For any reasons, this is only possible after a second click click respectively tap on the ListItem I have added an onClicked block in the delegate:

delegate: BackgroundItem {
    id: backgroundItem
    onClicked: {
        console.log("Force focus")
        searchField.forceActiveFocus()
    }
    ...
}

I played around with some approaches like Connections, but I couldn't find a solution, yet. Some ideas?