Trigger update
Is there a way to trigger the update programmatically?
@kraaden would be nice to have this feature implemented
Hello @kraaden
yes, it would be nice to have a method to fetch suggestions programmatically
Something like the jquery UI "search" -> https://api.jqueryui.com/autocomplete/#method-search
Thank you in advance
PS: showOnFocus is helpful but not the exact solution :+1:
@kraaden Great package many thanks for your time. I would agree an improvement would be to trigger the update programmatically, as I cannot find a way for right click + paste to be detected by the showOnFocus, even using the focus() native javascript command. The user has to manually type to invoke the fetch/update after right click and paste.
As a temporal hack this works for me at the moment
setTimeout(() => {
inputElement.dispatchEvent(new KeyboardEvent('keyup'));
}, 200);
This is in an Electronjs app, so I'm not concerned about browser compatibility. (I have an extra checkbox that changes the fetch, that's why I want to trigger the update)
@StuartCreed Now the autocomplete should display suggestions even if you insert text by mouse+right click (in the version 8).
In the latest version you can manually trigger updates like this:
const result = autocomplete({...});
result.fetch();