question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autocomplete control suggestion popup refresh

See original GitHub issue

Let’s say I use the following IAutocompleteSource implementation :

    public class TestClass : IAutocompleteSource
    {
        public ObservableCollection<Image> ItemsLst { get; set; }
        public IEnumerable Search(string searchTerm)
        {
            searchTerm = searchTerm ?? string.Empty;
            searchTerm = searchTerm.ToLower();

            return ItemsLst.Where(item => item.imgName.ToLower().Contains(searchTerm));
        }
    }

If later on, ItemLst content changes, it will not get reflected directly in the Autocomplete suggestion popup until something new is typed (which triggers the Search() method, I imagine, and refresh the IEnumerable).

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
spiegelpcommented, Dec 2, 2018

@Coloris This commit introduces the IAutocompleteSourceChangingItems interface and AutocompleteSourceChangingItems as an abstract implementation.

Derive your autocomplete source from AutocompleteSourceChangingItems and call the OnAutocompleteSourceItemsChanged() method, if the list changes. Then the Autocomplete will trigger a new search with the recent search term to get a new list of items.

I am planning to put it in a release next week.

0reactions
giganoidecommented, Mar 11, 2022

Same situation also for me. I tried the AutocompleteSourceItemsChanged but it doesn’t work. The @infirazor 's trick works but it is a little “dirty”…

Read more comments on GitHub >

github_iconTop Results From Across the Web

reload page after user click on autocomplete suggestion
I tried putting onclick()'s in the list of suggestions and have this reload the page but, for example, if user types "dubl" and...
Read more >
SQL Prompt Tip: how to control when the suggestion box ...
If you want Prompt to show suggestions only 'on demand', simply uncheck the Automatically show suggestions…box while leaving Show code ...
Read more >
add option to refresh auto-complete list instead of jumping
The autocomplete cannot be refreshed using standard Scintilla functions, as in update the initial list in the same popup window.
Read more >
refresh - API Reference - Kendo UI AutoComplete
In this article you can see how to use the refresh method of the Kendo UI AutoComplete. ... Refresh the suggestion popup by...
Read more >
IntelliSense in Visual Studio Code
Snippets in suggestions. By default, VS Code shows snippets and completion proposals in one widget. You can control the behavior with the editor....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found