[v3.0.1] How can I force searchbar to show input clear

Hi Vladimir I need to fire an event to display the “input-clear-button” .
It only appears when the real “change” of the input fires, but if I assign some text to the searchbar it’s not displaying.

Just trigger change event on input after you modified its value, e.g.:

$('.searchbar input').trigger('change')

Hi Vladimir, thanks for your answer. You know I’ve tried that and didn’t work in my case.
Do you have any other idea to force it to display?

The condition to show/hide input clear button is checking in change and input events, so should work, otherwise you can use app.input.checkEmptyState app method http://framework7.io/docs/inputs.html#input-app-methods

1 Like