Clear autocomplete after selection


I want to clear the autocomplete entry after selecting the suggestion list item. I'm using Xamarin forms with MVVM. I have tried making the selectedItem property as null and empty and notified, even then item is selected item is shown in the text box.

Below is the code snippet
.Xaml
<sf:SfAutoComplete HeightRequest="40" x:Name="autoComplete" SuggestionMode="Contains"
                                   DataSource="{Binding countryNames}" SelectedItem="{Binding SelectedAccessorie}" />
 

ViewModel
public string SelectedAccessorie
        {
            get
            {
                return _SelectedAccessorie;
            }
            set
            {
                _SelectedAccessorie = value;
                LoadAccessoriesList();
                OnPropertyChanged();
            }
        }
 

private void LoadAccessoriesList()
        {
            if (!string.IsNullOrEmpty(SelectedAccessorie))
            {
                SelectedAccessorie = "";
                OnPropertyChanged("SelectedAccessorie");
            }
        } 

4 Replies

RB Rabhia Beham Kathar Mideenar Syncfusion Team June 4, 2018 12:34 PM UTC

Hi Siva,

Thanks for contacting Syncfusion Support.

We have checked the reported issue in SfAutoComplete Control. We could able to reproduce the issue. We have logged the defect report for the same. And the fix will be available in Volume 2 Sp 1 release.

Please let us know if you have any concern.

Regards,
Rabhia Beham K.



AP Ashwini Paranthaman Syncfusion Team June 6, 2018 10:17 AM UTC

From: SivaShankar Arumugam  
Sent: Wednesday, June 6, 2018 5:28 AM
To: Syncfusion Support  
Subject: Re: Syncfusion support community forum 137912, Clear autocomplete after selection, has been updated. 

Thanks for the update. 
 
Could you please share the approximate date of release.  
 
Thanks, 
Siva  



RB Rabhia Beham Kathar Mideenar Syncfusion Team June 7, 2018 05:25 AM UTC

Hi Siva,

As promised earlier the fix will be available in Volume 2 Sp 1 release which will be rolled out by the end of this month.

Regards,
Rabhia Beham K.



PA Paul Anderson S Syncfusion Team July 25, 2018 05:33 AM UTC

Hi Siva, 
  
Sorry for the incovenience. We would like to let you know that due to stability fix will be included in our upcoming Volume 2 SP2 release which will be in the end of August 2018.  
  
Regards,  
Paul Anderson  
 


Loader.
Up arrow icon