Reputation: 2576
I added a autocompletion to an input field with jquery-textcomplete. In some cases, I want to close it programmatically without losing focus on the text field.
How can you close the dropdown in code?
Upvotes: 1
Views: 350
Reputation: 2576
This is a workaround, as the API currently does not support this feature.
jquery-textcomplete stores its information in the data attribute textComplete
. You can close the dropdown by calling it's deactivate function like this:
yourAutocompleteField.data("textComplete").dropdown.deactivate();
Upvotes: 1