We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ComboBox SelectionChanged not working on iOS

If there is only one item loaded into the choices for the selection box (but not yet selected), selecting it in the UX will *not* fire the selection changed event in iOS.

It *will* fire it for UWP. 

10 Replies

HM Hemalatha Marikumar Syncfusion Team January 3, 2020 12:11 PM UTC

Hi Scott, 
  
Greetings from Syncfusion. 
  
We would like to let you know that we have prepared a sample to have a collection of ComboBox with single item and ensured this with or without ItemTemplate and checked, but we were unable to reproduce the issue. SelectionChanged event is triggered when the item is selected. Please find the testbed sample and screenshot below 
  
 
Screenshot:  
 
 
 
Please check this and let us know if you have any other concern. 
 
Regards, 
Hemalatha M. 
 



SC Scott January 3, 2020 03:31 PM UTC

I tried opening your sample to modify it to match my use case. I couldn't get it (in a short period of time) to actually run as a Xamarin.Forms app. I think if you replace the contents of these two files, you'll see the problem as you switch between one and more than one item in the ComboBox using the buttons I added. XAML:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:ComboBoxSample"
             xmlns:combobox="clr-namespace:Syncfusion.XForms.ComboBox;assembly=Syncfusion.SfComboBox.XForms"
             x:Class="ComboBoxSample.MainPage">
   
    <StackLayout VerticalOptions="Start" HorizontalOptions="FillAndExpand" Padding="0,100,0,0">
        <Button
            Text="Load Many"
            x:Name="LoadManyButton"
            HorizontalOptions="Center"
            Padding="10"
            HeightRequest="66"
            Margin="34,10,0,0"
            Clicked="LoadManyClicked" />
        <Button
            Text="Load One"
            x:Name="LoadOneButton"
            HorizontalOptions="Center"
            Padding="10"
            HeightRequest="66"
            Margin="34,10,0,0"
            Clicked="LoadOneClicked" />
        <combobox:SfComboBox
            HeightRequest="40"
            SelectionChanged="ComboBox_SelectionChanged"
            x:Name="comboBox">
        </combobox:SfComboBox>
    </StackLayout>
</ContentPage>

and the .cs:

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace ComboBoxSample
{
 public partial class MainPage : ContentPage
 {
  public MainPage()
  {
   InitializeComponent();
  }
        private void ComboBox_SelectionChanged(object sender, Syncfusion.XForms.ComboBox.SelectionChangedEventArgs e)
        {
            DisplayAlert("Selection Changed", "SelectedIndex: " + comboBox.SelectedIndex, "OK");
        }
  private void LoadManyClicked(object sender, EventArgs e)
        {
   if (comboBox.ComboBoxSource != null && comboBox.ComboBoxSource.Count > 0)
            {
                comboBox.ComboBoxSource.Clear();
                comboBox.Text = string.Empty;
            }
            List<string> lsPickerCombo = new List<string>();
            for (int iCntr = 0; iCntr < 5; iCntr++)
                lsPickerCombo.Add("Testing " + iCntr.ToString());
            comboBox.ComboBoxSource = lsPickerCombo;
        }
  
  private void LoadOneClicked(object sender, EventArgs e)
  {
   if (comboBox.ComboBoxSource != null && comboBox.ComboBoxSource.Count > 0)
            {
                comboBox.ComboBoxSource.Clear();
                comboBox.Text = string.Empty;
            }
            List<string> lsPickerCombo = new List<string>();
            lsPickerCombo.Add("Single Entry");
            comboBox.ComboBoxSource = lsPickerCombo;
  }
    }
}



HM Hemalatha Marikumar Syncfusion Team January 6, 2020 12:59 PM UTC

Hi Scott, 
 
Greetings from Syncfusion. 
 
We would like to let you know that currently we are validating the reported things at our end and we will update the complete details on January 7,2020. 
 
Regards, 
Hemalatha M. 



HM Hemalatha Marikumar Syncfusion Team January 7, 2020 02:00 PM UTC

Hi Scott, 
  
Thanks for the patience. 
  
We would like to let you know that we were able to reproduce the issue and we are validating the root cause for the reported issue. We will update you on the status on January 9th, 2020. 
  
Regards, 
Hemalatha M. 



SC Scott January 7, 2020 02:20 PM UTC

Thank you. 

For what it's worth, I think I also found another iOS-only bug in your sfTabView. 

In both Android and iOS, setting the .SelectedIndex value will activate the target tab. (In my case, one of 3 tabs.) But directly setting .SelectedIndex doesn't work in iOS. 

I think I can work around that on my end, essentially faking a tabview since my use case is fairly simple, but I thought you might want to know about it.


HM Hemalatha Marikumar Syncfusion Team January 8, 2020 02:11 PM UTC

Hi Scott,

 
 
Thanks for the update. 
 
We would like to let you know that we have checked the query and modified the sample. Instead of using List, we have used ObservableCollection which will notify when the collection is changed and store to the Combobox data source. We have found an issue with the changes and we have fixed that. Please find the patch and sample from below link 
 
 
Assemblies: 
 
Assembly Version: 17.4.0.40 
 
Currently, we don’t have patch support for weekly Nuget release. Hence only provided this fix through the custom assembly. 
 
Guidelines to use this custom assembly: 
 
Before applying this, please clear the cache 
 
 
Please do as per in below link when configured with Nuget in your application 
 
 
 
This fix will be included in our weekly Nuget release which is expected to be rolled out on 14th January 2020. 
 
Regards, 
Hemalatha M. 



SC Scott January 14, 2020 11:07 PM UTC

Looks like you got the iOS notification fixed. Unfortunately, the UWP doesn't always display its content list (iOS and Android do, with the same code and data), so I'm not sure I have time to go another round of this.


PK Praveen Koildasan Syncfusion Team January 15, 2020 08:44 AM UTC

Hi Scott,

We have ensured the reported issue in UWP platform and it is working fine from our side. Please update the issue reproducing sample which will be more helpful for us to provide you further solutions on this.

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBoxSample1539649225.zip 

Regards,
Praveen K.



SC Scott January 15, 2020 03:55 PM UTC

I don't know if I have time to try and build a case to replicate it. Here is a screen shot of the UWP:


and it is always the 2nd (not the 1st or 3rd) combobox that fails to show the options. Though you can tell that there are two of them, by the size of the drop list, and if you click the first one, you get:


which is one of the selections. But if you run this on Android, or iOS:


the exact same code shows the list items. 

There must be some interaction between the comboboxes only on UWP, but I can't really explain it. I'm a contract developer, and I can't post the code for the app here, and I need to focus on providing a solution to the client. 


AS Anandraj Selvam Syncfusion Team January 17, 2020 01:43 PM UTC

Hi Scott,

We would like to let you know that we have prepared a sample to check the reported issue but we were unable to reproduce the issue. We have checked by adding the items in both DataSource and ComboBoxSource and SfComboBox is working as expected. Please find the sample and screenshot below:

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBox_Selection-260671478  


Screenshot:
 
 

Since we are not aware of your exact application scenario, could you please share the following details to check it further and provide a possible solution at earlier.

· Modifying the above-provided sample to replicate the issue

· If possible, can you please share the issue reproducing sample along with replication procedure


Thanks,
Anand Raj S.

Loader.
Live Chat Icon For mobile
Up arrow icon