-
Notifications
You must be signed in to change notification settings - Fork 232
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
Dynamically add results without reinitiating the typeahead #206
Comments
This is a workaround that seems to do the trick:
Obviously I also need to figure out a way to delete the old appended value. |
Although my hacky workaround is on the way, there are many obstacles. Ideally, a function to "re-render" suggestions is needed. Listening on keyup/keydown is too agreesive, and wont work with "CTRL+A" for instance. Using keyup works a long way, but after the suggestion has been added, you need to add a space or delete and reenter the latest typed letter, before the suggestion appears, because suggestions have already been rendered. It would be very nice if you could trigger the event to "rerender" suggestions. |
This is my hacky workaround. It does the job, but would be sweet with some more direct APIs. The solution is to create a new dataset, just for the dynamic keywords, as there is no way to remove a specific suggestion from an existing bloodhound engine.
|
After seeing the documentation and that you can show suggestions if no query has been made, I tweaked this code, and figured out an even better solution. More clean, and doesn't depend on events workaround.
|
I unfortunately do not understand your question. |
Is there a way to dynamically add new content without reinitiating the typeahead?
For instance, a specific usecase, I need to show a result that is dependent on the user input. For instance, if the typeahead value is "something", I need to display a result, where the datum.value is "bla bla something"
Seems mentioned here as well: #161
The text was updated successfully, but these errors were encountered: