SfAutoComplete crashes the app when clear button clicked (Android)

I'm using SfAutoComplete (VS 2017, Xamarin Forms) to select a city name from a list of cities, everything works fine but when I click the clear x button (on Android) the application crashes 
and it goes on break mode...any ideas as to what is causing this?

7 Replies

SK Selva Kumar  Veerakrishnan Syncfusion Team February 22, 2018 12:23 PM UTC

Hi Astrit,

Thank you for contacting Syncfusion Support.

We could not reproduce the issue “AutoComplete crash on clicking the clear button”. We have prepared a simple sample for the same, please download the same from the link given below.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Autocomplete-943353631.zip

Also we would link to say that our 2018 Volume 1 has been rolled out, please download our Essential Studio Volume 1, 2018 (Version 16.1.0.24) is rolled out and is available for download under the following link.

https://www.syncfusion.com/forums/136049/essential-studio-2018-volume-1-release-v16-1-0-24-is-available-for-download
 
Check whether the issue could reproduced from this release.

If you could reproduce, please update us with the sample modification with the replication steps.

Regards,

Selva Kumar V.


AB Astrit Bako February 22, 2018 04:22 PM UTC

Hi, thanks for the reply below is the code I'm trying to implement, when deleting letters using delete from keyboard works ok, but if I click on x clear button inside the SfAutoComplete  it crashes the app.


public async void autocomplete_SelectionChanged(object sender,Syncfusion.SfAutoComplete.XForms.SelectionChangedEventArgs e)
        {
          
            if (!string.IsNullOrWhiteSpace(autoComplete.SelectedValue.ToString()))
            {
              
                city = autoComplete.SelectedValue.ToString();
              
                if (!string.IsNullOrEmpty(city))
                {
                    com = await dal.GetCompanyBySpecialityCity(city, speciality);
                }
              
                if (com!=null && com.Count > 0 && city!=null)
                {
                    lst.ItemsSource = com;
                }
                else
                {
                    await DisplayAlert("List", "No items found matching your criteria", "Ok");
                    lst.ItemsSource = null;
                    autoComplete.Clear();
                }
             
            }   
          
        },


CP Chozarajan Pandiyarajan Syncfusion Team February 23, 2018 08:54 AM UTC

Hi Astrit,

Thank you for your update.

We have able to reproduce the reported issue in SfAutoComplete. While clicking the Clear Button in SfAutoComplete control the SelectedItem and SelectedValue will become null. So while you have checked the SelectedValue and converted the SelectedValue to string which is null and it throws null exception and app crash occurs. We have modified your SelectionChangedEvent and attached the sample for your reference.

Sample Link: http://www.syncfusion.com/downloads/support/forum/136039/ze/AutoCompleteSample1472686671 

Please let me know if the issue resolved your side.

Regards,
Chozarajan P 



AB Astrit Bako February 23, 2018 08:57 AM UTC

Thank you very much for your support, it works perfectly.


RB Rabhia Beham Kathar Mideenar Syncfusion Team February 26, 2018 06:55 AM UTC

Hi Astrit,

Thanks for your update. We are glad that you have achieved your requirement.

Regards,
Rabhia Beham K.






FA Fabio May 13, 2021 03:05 PM UTC

Xamarin IOS Crash when selection value from list (only on some elements) 
AppDelegate error -> System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'


SS Suganya Sethuraman Syncfusion Team May 14, 2021 08:17 AM UTC

Hi Fabio,

Greetings from Syncfusion.

We have analyzed the reported issue. we have prepared a sample, but we were unable to replicate the issue.

Please have a sample,

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

Since we are not aware of exact scenario of the issue, could you please check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the runnable sample or full stack trace.  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