Open csimpi opened 4 years ago
This happens because the so-called async
isn't actually asynchronous. Because JavaScript is single-threaded, the Promise
happens to be resolved all-at-once. There's a race condition here in the library (and a simple patch to change the order of calls might be sufficient), but for now, I would recommend making your asynchronous filter actually asynchronous. It is enough to replace the resolve(items)
with:
setTimeout(() => resolve(items), 0);
https://play.nativescript.org/?template=play-ng&id=18mghh&v=2
@facetious Nice workaround, and thank you for the explanation!
Please, provide the details below:
Tell us about the problem
When I use
loadSuggestionsAsync
withRadAutoCompleteTextView
I can't show up theNo Results
message. If I resolve the Promise with an empty array[]
it shows loading spinner instead ofNo Results
message.Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
√ Getting NativeScript components versions information... √ Component nativescript has 6.5.0 version and is up to date. √ Component tns-core-modules has 6.5.1 version and is up to date. √ Component tns-android has 6.5.1 version and is up to date. × Component tns-ios is not installed.
Please tell us how to recreate the issue in as much detail as possible.
Open this sample and follow the instructions on the screen: https://play.nativescript.org/?template=play-ng&id=18mghh
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
(You can paste entire code snippets, link to playground demo or attach a runnable project)