-
Notifications
You must be signed in to change notification settings - Fork 88
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
How to ignore outdated search result? #91
Comments
id you try 300 for 300ms. |
Hi Ralf, I would try the debounce hint from @thedanielhanke and I will change this behavior as part of the #57 as there I will change how the @thedanielhanke thanks a lot for the hint! Thanks and regards, Guy |
@thedanielhanke : Not sure if I understood that correct, but doing something like
Would only delay the selected value - not the live updates for the search list, right? At least it doesn't seem to work as expected. |
@guylabs : |
@Screeze debounce would not only delay, it also resets the delay when the input value is changed within that period - or as the documentation tells: " and/or a debouncing delay so that the actual update only takes place when a timer expires; this timer will be reset after another change takes place." in your case, like it does in mine, this should lead to:
|
@thedanielhanke Sure, I know what it should do. I define the debounce on a text-input which defines the autocomplete. But the actual input of texts does not happen in this input. It happens in an overlay, generated by the autocomplete, with this input field:
The debounce is added to the input which is part of my form, not the search-input. So the debounce would delay writing back the selected value, probably, but it does not delay the search queries. |
Hi Ralf, well if it is possible I can get the debounce attribute from the outter input field and then pass it to the inner input field such that this works. What do you think about that? Thanks and regards, Guy |
That would be an idea. Unfortunately this has may have the side effect, that also writing back the data from the selected value to the viewmodel could be delayed, right? |
Hi Ralf, I just updated the behavior of the And I will have a look at the debounce thing to try to add it on the inner input field. Thanks and regards, Guy |
Hi Ralf, I just added the ability to pass the Thanks and regards, Guy |
Hi Ralf, any news on this? I want to release Thanks and regards, Guy |
Hi, I also tried the possibility to return undefined as search result to not clear the results, and it seems to work well. Not sure though, how I can make this smart (like: showing results if the search is more up to date then the shown results, but not returning anything if the shown results are already newer then the current search.) But that's something I can solve with some counter logic probably. I'm just wondering, if for future versions, this could be some mechanism implemented within the autocomplete itself. Now i have 4 autocompletes within my application, querying 4 different endpoints, which all would need that logic. If this was in-built, it would be a lot easier. Maybe for a future version, you could think of something like this: Kind regards and thanks for your work, Ralf |
Hi Ralf, ok nice thanks a lot for testing. Well I think if you use a decent debounce value then this issue can be minimized such that it just occurs in some circumstances and therefore I think it is better to have it in the users code instead of the component itself as this adds more complexity to the code just for some "small" optimizations. Do you know what I mean? If you have an example of how you are doing it maybe I can add it to the documentation as a best practice example or something like that. Then I will close the issue and merge the #57 branch to the master and then release Thanks a lot and regards, Guy |
Hi,
if the user types kind of fast and the search queries to the backend return in a different order, currently the wrong search results are shown.
Example:
I could handle this on service base with recognizing the last sent query and ignore any other result. But I don't know how to tell the widget to ignore the return value. If I would return an empty value, the search results would be empty until the correct query returns. Instead I want to leave the current search result and don't provide something new.
Is this possible? If yes: how?
The text was updated successfully, but these errors were encountered: