You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an error in the async function when calculating the value for the rendered variable... This makes succesive calls to this funcion not appending the suggestions:
This way, the result of rendered - limit it's always added to rendered, so rendered will always end up having the value of limit!... For example, let's say we have already rendered 10 suggestions in a previous call to async, and that the limit is set to 1000. Then idx will be calculated as 1000-10=990... and thus when adding this amount to rendered (whose value is 10) the result will be again 1000 (the limit). This would make the next call to async to be over the limit and the new suggestions will not be added.
Hello!,
I noticed an error in the async function when calculating the value for the rendered variable... This makes succesive calls to this funcion not appending the suggestions:
This way, the result of rendered - limit it's always added to rendered, so rendered will always end up having the value of limit!... For example, let's say we have already rendered 10 suggestions in a previous call to async, and that the limit is set to 1000. Then idx will be calculated as 1000-10=990... and thus when adding this amount to rendered (whose value is 10) the result will be again 1000 (the limit). This would make the next call to async to be over the limit and the new suggestions will not be added.
In my Iocal file I have solved it this way:
It is as simple as applying a Math.max between the result of rendered - limit and suggestion.length.
Hope this helps someone.
Thank you.
The text was updated successfully, but these errors were encountered: