SfCombobox popup opens when changing DataSource in Threadpool

Hello, I don't know if that's a problem with Combobox, I'm using it to do a LazyLoading search using 'ValueChanged' event from SfComboBox, so every time I tap a letter, the DataSource changes, the problem is that every time that I select an item, the popup combobox gets focused and DropDown open again (instead of keeping closed), it triggers when I select, of course because of ValueChanged event, but popup only opens if I change the DataSource from a ThreadPool.


XAML

                                    <combobox:SfComboBox x:Name="contactComboBox"

                                                             SuggestionBoxPlacement="Auto"

                                                             IsEditableMode="True"

                                                             PopupDelay="500"

                                                             SelectedItem="{Binding Contact}"

                                                             ShowClearButton="True"

                                                             DataSource="{Binding Contacts}"

                                                             DisplayMemberPath="Name">

                                            <combobox:SfComboBox.Behaviors>

                                                <prism:EventToCommandBehavior EventName="ValueChanged"

                                                                              Command="{Binding ContatactSearchCommand}"

                                                                              CommandParameter="{Binding Text, Source={x:Reference contatactComboBox}}" />

                                            </combobox:SfComboBox.Behaviors>



ViewModel method

That's not the method I'm using, but the exact same problem ocurrers if using it that way


private async void ContactSearch(string text)

{

Task.Run(() =>

{

Contacts = Contacts.Where(x => x.Name.Contains(text));

});

}


It also happens if using that way:

private async void ContactSearch(string text)

{

await Task.Delay(100);

Contacts = Contacts.Where(x => x.Name.Contains(text));

}


If we don't use Task.Run, the problem doesn't ocurrers


10 Replies 1 reply marked as answer

SR Shivani Ramakrishnan Syncfusion Team August 30, 2022 01:36 PM UTC

Hi Felipe,


Query: SfComboBox Popup opened When Changing DataSource in Threadpool


We are unable to replicate the reported issue on our side. We have prepared a sample for your reference. Please get it from the attachment.


If still you face any issues, please share the issue replication sample with steps to check further. It will help us to provide a better solution earlier.


Regards,

Shivani


Attachment: ComboBoxPopUp_2d0e4633.zip


FE Felipe August 30, 2022 03:42 PM UTC

I tried using code behind and the problem didn't happened at all, it happens if using MVVM pattern with prism.


I modified the sample to replicate the issue.





Attachment: ComboBoxPopUpIssue_afd378d9.rar


VV Vijayakumar Viswanathan Syncfusion Team August 31, 2022 01:49 PM UTC

Hi Felipe,


Query: SfComboBox Popup opened When Changing DataSource in Threadpool


We have reproduced the reported issue at our end. We will let you know the details on September 1, 2022. We appreciate your patience until then.


SfComboBox has the capability to load even 100 thousand items smoothly and supports filtering the items through the AllowFiltering property, So we recommend you to directly use SfComboBox for loading and searching the items. So you can't get any dropdown issue like the reported one. If you have faced any difficulties, please let us know, and we will be here to assist you.


Regards,

Vijaykumar V



FE Felipe August 31, 2022 03:31 PM UTC

It's not possible to me to use directly SfCombobox, we have users that have thousands of contacs and the request would delay, but I found a Workaround for that problem, instead I found a problem and a very strange behavior in iOS.

When updating DataSource in iOS in ValueChanged, It causes an exception when select an item and try to scroll, and SelectedItem doesnt update, It only ocurrers in iOS.


Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index




RS Ruba Shanmugam Syncfusion Team September 1, 2022 11:46 AM UTC

Hi Felipe,


Query: When updating DataSource in iOS in ValueChanged, It causes an exception when select an item and try to scroll, and SelectedItem doesnt update, It only ocurrers in iOS.


We have checked the provided sample in the last update, but we couldn’t able to replicate the reported issue in iOS when selecting the item from the dropdown. We have recorded a video for your reference, can you get the video and sample from the attachment?


We ask you to try our sample and if your requirement is different, please explain to us briefly and share the replication steps with the sample. It will help us to provide the proper solution at the easiest.  Please let us know if you need any other details.


Regards,

Ruba Shanmugam


Attachment: ComboBoxPopUp_Sample_Video_f84991d.zip


FE Felipe September 2, 2022 03:56 PM UTC

I could replicate the problem by using FodyPropertyChanged lib, but I don't know why this happens in iOS



RS Ruba Shanmugam Syncfusion Team September 5, 2022 02:05 PM UTC

Hi Felipe,


Query: I could replicate the problem by using FodyPropertyChanged lib, but I don't know why this happens in iOS.


We have prepared the sample based on the provided information using the FodyPropertyChanged with Prism, but we couldn’t able to replicate the reported issue in iOS when selecting the item from the dropdown. We have prepared a sample for your reference and get the sample from the attachment?


We ask you to try our sample and if your requirement is different, please explain to us briefly and share the replication steps with the sample. It will help us to provide the proper solution at the easiest.  Please let us know if you need any other details.


Regards,

Ruba Shanmugam


Attachment: ComboBox_Fody_MVVM_f9606b1a.zip


FE Felipe September 8, 2022 04:39 AM UTC

I recorded the issue in iOS, I put some entries to simulate a scrollable form, there's also a sample in the archive.


Attachment: ComboBoxPopupSample_936df0b3.rar


RS Ruba Shanmugam Syncfusion Team September 8, 2022 12:26 PM UTC

Hi Felipe,


We have checked the reported issue and we could able to reproduce the issue. We have fixed the issue Index was out of range when scrolling the view. Please find the fixed sample with assemblies in the attachment.


Assembly version: 20.2.0.46


Please note that we have created these assemblies for version 20.2.0.46 specifically, to resolve the issue reported in this ticket. If you have received other patches for the same version for other products, please apply all patches in the order received.


Note: Please refer to the below link to apply the custom assembly


https://www.syncfusion.com/kb/8279/how-to-apply-the-custom-assemblies-when-configured-the-project-with-syncfusion-nuget


We will include the fix in our upcoming weekly release, which is scheduled to roll out on September 20, 2022.


Disclaimer: The inclusion of this solution in the weekly release may change due to other factors, including but not limited to QA checks and work reprioritization.


Regards,

Ruba Shanmugam


Attachment: SfComboBox_Assembly_d88b9104.zip

Marked as answer

RS Ruba Shanmugam Syncfusion Team September 21, 2022 04:25 AM UTC

Hi Felipe,


Thanks for your patience.

We have included the fix in our latest Weekly NuGet release v20.2.0.50 which is available for download (https://www.nuget.org/ ). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.


Regards,

Ruba Shanmugam


Loader.
Up arrow icon