Pixabay / JavaScript-autoComplete

An extremely lightweight and powerful vanilla JavaScript completion suggester.
752 stars 186 forks source link

How to submit the form on enter or mouse click onSelect? #70

Closed dcalixto closed 6 years ago

dcalixto commented 6 years ago

After setup the script and show the results we need to click the search post button to complete the action, but i would like to on the suggestion submit the form without need to select. is that possible with the onSelect callback?

enomado commented 6 years ago

I've done it in my fork https://github.com/enomado/JavaScript-autoComplete

You can pass your own onSelect there. But It's fully unmergeable and unmaintainable. Perhaps there are almost any feature in some of this library fork :)

dcalixto commented 6 years ago

@enomado thank you very much!

dcalixto commented 6 years ago

@enomado just one doubt, did you removed the (term, response) ? so onSelect: function(e, term, item) dis not use the (e, term, item) ?

enomado commented 6 years ago

It accepts even more: onSelect: function({ event, value, choice, object, method }). but i'm not sure it can tun on <es6

dcalixto commented 6 years ago

great! thank you @enomado