[v2] Autocomplete searchBar - Handle On Clear event

Hi Vladimir, Is there any event inside autocomplete that I can use to handle when the user clear the autocomplete?

I dont know if there is a method for that. But you can try like this:

Dom7(Dom7('#autocompleteId .input-clear-button')).on('click', function(e) { alert('clear!!!')})

Yes, I did that, but It would be fantastic to have it

Just curious. Is there a specific reason to wrap Dom7 inside Dom7 since the return would be a Dom7 element?

If you’re looking for an event to listen to based on original code, closest is to use the ‘change’ event and check for length 0. But then, it can be triggered by deleting inside as well.

Perhaps can be a feature request? Or you can edit the base js and emit a new event that you can listen to when clear is pressed

sry no, i just copy and paste from the console, was testing

I think that would be useful to have it as a feature.
The onchange is not fire in that case.