- Home
- Forum
- Xamarin.Forms
- Clearing selected autocomplete item is causing UI issue
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" />
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.
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
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.
Hi,
This issue has come back when we upgraded to the release version 20.2.0.36,
could you please provide your feedback
Thanks
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
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.
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
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
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
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
- 11 Replies
- 3 Participants
- Marked answer
-
JB John Burns
- Jul 26, 2021 08:42 AM UTC
- Aug 1, 2022 10:45 AM UTC