Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger update #52

Closed
ftomassetti opened this issue Apr 9, 2020 · 6 comments
Closed

Trigger update #52

ftomassetti opened this issue Apr 9, 2020 · 6 comments

Comments

@ftomassetti
Copy link

Is there a way to trigger the update programmatically?

@ftomassetti ftomassetti changed the title Trigger updat Trigger update Apr 9, 2020
@hyyan
Copy link

hyyan commented Jun 5, 2020

@kraaden would be nice to have this feature implemented

@pontikis
Copy link

pontikis commented Dec 19, 2020

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 👍

@StuartCreed
Copy link

@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.

@eeemarv
Copy link

eeemarv commented Dec 13, 2021

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)

@stale stale bot added the wontfix label Dec 10, 2022
Repository owner deleted a comment from stale bot Dec 10, 2022
@stale stale bot removed the wontfix label Dec 10, 2022
@kraaden
Copy link
Owner

kraaden commented Feb 8, 2023

@StuartCreed Now the autocomplete should display suggestions even if you insert text by mouse+right click (in the version 8).

@kraaden
Copy link
Owner

kraaden commented Feb 14, 2023

In the latest version you can manually trigger updates like this:

const result = autocomplete({...});
result.fetch();

@kraaden kraaden closed this as completed Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants