afcapel / stimulus-autocomplete

Stimulus autocomplete component
MIT License
478 stars 61 forks source link

Additional event on select #109

Open pySilver opened 2 years ago

pySilver commented 2 years ago

Hey!

That would be nice to have an event when select occurs, so one can dynamically update input value. That would allow to follow the same logic as Google and others use when suggestions are works as query prefix rather than final query.

afcapel commented 2 years ago

@pySilver autocomplete.change already fires when the user selects a value. You can indeed use it to update other fields in the form.

pySilver commented 2 years ago

@afcapel it fires when selection is committed. I've meant an event that would be fired while user perform arrow navigation (when select method is called)

afcapel commented 2 years ago

Oh, I see, feel free to send a PR if you need the event 👍