Async empty Datasource after refresh causes reset of selecteditems

I'm using a Token multiselect with an async datasource

After searching the datasource gets filled with data.
I can select an item from the list and it gets added to my bound selectedItem collection
The selection automatically triggers another search("selected item name") which returns an empty list for the Datasource as the selected item is filtered.

Now sometimes out of the blue when selecting an item, the selectedItem Collection is simply cleared without any debug output.

I updated to the latest packages 
Syncfusion.Xamarin.Core Version="18.3.0.40"
Xamarin.Forms Version="4.8.0.1560"

the xaml looks like this
<combobox:SfComboBox DataSource="{Binding Exercises}" 
                                 SelectedItem="{Binding SelectedExercises, Mode=TwoWay}"
                                 DisplayMemberPath="Name" 
                                 NoResultsFoundText="Nothing Found" 
                                 HeightRequest="40" EnableAutoSize="True"  x:Name="exerciseComboBox" 
                                 ValueChanged="ExerciseComboBox_ValueChanged"
                                 MultiSelectMode="Token" TokensWrapMode="Wrap"
                                 MaximumDropDownHeight="200" 
                                 Watermark="Search Exercise..." IsEditableMode="true"/>



3 Replies

MI Michael October 20, 2020 12:27 PM UTC

After trying to replicate the scenario with one of your examples I was able to identify the reason.

When selecting an item, the SelectedItem is set AFTER the ValueChanged Event is triggered, which in my case starts a new search and somehow the SelectedItem set is called with a null value.

I think this is a bug
I circumvented it by applying the await Task.Delay(500); in the valuechanged method.


SS Suganya Sethuraman Syncfusion Team October 20, 2020 02:12 PM UTC

Hi Michael,

We are currently Validating on this with high priority and we will update the details on or before October 22nd, 2020. We appreciate your patience until then.

Regards,
Suganya Sethuraman. 




SS Suganya Sethuraman Syncfusion Team October 23, 2020 07:18 AM UTC

Hi Michael,

We have analyzed the reported issue. We have prepared a sample based on the information provided. We have tried to replicate the reported issue at our end, we are afraid that we are not able to reproduce the issue at our end. We have attached sample for your reference.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/CombBoxAsync216018123

Since we are not aware of your exact application scenario, we were not able to reproduce this issue at our end, so can you please provide complete runnable sample. This will be helpful for us to investigate further and provide you a better solution at the earliest.

Regards,
Suganya Sethuraman.     
 


Loader.
Up arrow icon