Clearing selected autocomplete item is causing UI issue

I have 3 SFAutoComplete components, changing the value of the first one is resetting the selected values of the other two, each component is bound by SelectedItem property with a property in the view model.

When  Items1_ChangedCommand selection changed event is triggered, I'm setting SelectedItem2 and SelectedItem3 to null, I also tried to call autoComplete.Clear() and  autoComplete.IsFocused = false for them with no use.

Setting the SelectedItem2 and  SelectedItem3 to null is forcing the Focus and the suggestion box to be shown for both of them, which causes the suggestion box sometimes to be shown empty with this design. 



<autocomplete:SfAutoComplete                       

                            DataSource="{Binding Items1}"

                            SelectedItem="{Binding SelectedItem1, Mode=TwoWay}"

                            DisplayMemberPath="Name"

                            ShowSuggestionsOnFocus="True" >

                           <autocomplete:SfAutoComplete.Behaviors>

                                <behaviors:EventToCommandBehavior EventName="SelectionChanged"

                                                                  Command="{Binding Items1_ChangedCommand}" />

                           </autocomplete:SfAutoComplete.Behaviors>

</autocomplete:SfAutoComplete>

<autocomplete:SfAutoComplete                       

                            DataSource="{Binding Items2}"

                            SelectedItem="{Binding SelectedItem2, Mode=TwoWay}"

                            DisplayMemberPath=" Name"

                            ShowSuggestionsOnFocus="True" />

<autocomplete:SfAutoComplete                       

                            DataSource="{Binding Items3}"

                            SelectedItem="{Binding SelectedItem3, Mode=TwoWay}"

                            DisplayMemberPath=" Name"

                            ShowSuggestionsOnFocus="True" />


11 Replies 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team July 27, 2021 12:57 PM UTC

Hi John,

Greetings from Syncfusion.

Currently we are validating on this, and we will update complete details on July 29, 2021. We appreciate your patience until then.

Regards,
Suganya Sethuraman.
 



SS Suganya Sethuraman Syncfusion Team July 30, 2021 12:59 PM UTC

Hi John,

Thanks for your patience.

We were able to reproduce the reported issue and we confirm this as a bug and logged a defect report. You can keep track of the bug from the feedback portal below.

Link: https://www.syncfusion.com/feedback/27497

The provided feedback link is private, and you need to login to view this feedback.

The fix for the reported issue will be available on August 13, 2021.

If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.

Regards,
Suganya Sethuraman
 



RS Ruba Shanmugam Syncfusion Team August 13, 2021 01:01 PM UTC

Hi John, 
 
Thanks for your patience. So we have fixed the issue “Clearing selected autocomplete item is causing UI issue” and find the patch from below link. 
 
Please find the patch setup from the below location.    
   
 
or    
    
Please find the patch assemblies from the below location.    
 
 
or   
    
Please find the NuGet from the below location. 
    
 
Assembly Version: v19.2.0.55    
      
Disclaimer:  
  
Please note that we have created this patch for version 19.2.0.55  specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received 
  
Follow the below link to clear cache,   
   
   
The fix will be included in our weekly Nuget release which is expected to be rolled out on August 24, 2021. 
 
Regards, 
Ruba Shanmugam 



SS Suganya Sethuraman Syncfusion Team August 25, 2021 04:53 AM UTC

Hi John,

Thanks for your patience.

We have included the fix in our latest Weekly NuGet release v19.2.0.57 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,
Suganya Sethuraman. 



JB John Burns July 15, 2022 02:36 PM UTC

Hi,

This issue has come back when we upgraded to the release version 20.2.0.36, 

could you please provide your feedback


Thanks




RS Ruba Shanmugam Syncfusion Team July 18, 2022 02:07 PM UTC

Hi John,

We have fixed the reported issue Clearing selected autocomplete item is causing UI issue”. Please find the assemblies in the attachment.


Patch version: 20.2.0.36

Disclaimer:

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

Note: Please clear the NuGet cache, before using the latest one.

https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache

This fix will be included in our upcoming weekly release which is expected to roll out on mid of July 26, 2022. We appreciate your patience until then.


Regards,

Ruba Shanmugam


Attachment: SfAutoComplete_Assembly_4f775dc4.zip

Marked as answer

JB John Burns July 26, 2022 01:34 PM UTC

Hi

We have updated to weekly release V20.2.0.40, the issue has not been fixed yet, could you please provide your feedback.


Much appreciated.





RS Ruba Shanmugam Syncfusion Team July 27, 2022 10:30 AM UTC

Hi John,


Query: We have updated to weekly release V20.2.0.40, the issue has not been fixed yet


We have checked the reported issue with the latest version V20.2.0.40 and the issue was not replicated on our side. We have prepared a new sample and video for your reference and please get it from the attachments.


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: AutoCompleteSample_Video_848d0b36.zip


JB John Burns July 27, 2022 12:39 PM UTC

Hi,

Thanks for your reply, there is a slight difference between the provided sample and the reported issue. I've modified your project and provided a video.


Please note that in the reported issue, we are setting the bindable SelectedItem property directly to Null without accessing the Syncfusion component as we can't track this component in our ViewModel.


There is also this instant switch of focus to the first SfAutoComplete component, could you please tell us why this is happening? is it because we are changing the SelectedItem property directly?


Please let us know your feedback,


Much appreciated



Attachment: AutoCompleteSample_Video_848d0b36_62792c93.zip


RS Ruba Shanmugam Syncfusion Team July 28, 2022 12:12 PM UTC

Hi John,


Thanks for providing a sample. Currently, we are validating the reported issue and we will let you know the details on  August 1, 2022. We appreciate your patience until then.


Regards,

Ruba Shanmugam



RS Ruba Shanmugam Syncfusion Team August 1, 2022 10:45 AM UTC

Hi John,


Query: There is also this instant switch of focus to the first SfAutoComplete component, could you please tell us why this is happening?


We have checked the reported query in the source. We have used the default TextBox added inside the ScrollView. We could able to replicate the focus jumps to the top-most TextBox when interacting with the Microsoft TextBox also. Please check the below link,


Find the issue link below,

https://github.com/microsoft/microsoft-ui-xaml/issues/597


In UWP by default design, any one of the elements will focus. So if we clear any focus the first AutoComplete gets focus by default. We have a workaround solution to resolve this issue. We can place an invisible button at the top of the layout. The button will be focused on when the layout was tapped. The AutoComplete will not be focused.


We have prepared a sample for your reference and please get it from the attachment. Please let us know if you have any other concerns.


Regards,

Ruba Shanmugam



Attachment: AutoCompleteSample_70f806b6.zip

Loader.
Up arrow icon