You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ComboBox incorrect behavior when using Items property #87
Here the items are of type ComboBoxItem, which is a view.
Since views can only have one parent, when ComboBox.UpdateContentPresenter() sets its _contentPresenter.Content to the SelectedItem, the parent of the item becomes that ContentPresenter, which explains why it's not in the dropdown list anymore.
One option would be to implement in Uno the specifics of CarouselPanel that make the dropdown expand around the selected item (if we want the same behavior as UWP).
If you simply want to display strings in your ComboBox I suggest that you use the ItemsSource attribute instead of creating ComboBoxItems manually.
In android,i can define a ItemTemplate of ComboBox,then the behaviour of ComboBox is well.
In IOS, it's not work still! I define a List as the ItemsSource value,it's still show nothing.
@jeromelaban ,do you know How to deal with it? Thank you!
Using a list for ItemsSource should work on both on ios & android. And, depending on what type of the list you get, you might need to set the DisplayMemberPath.
Activity
double28 commentedon Oct 10, 2018
in android,the last selected item dispeared! in ios,no item show!
leboeuf commentedon Oct 11, 2018
Here the items are of type ComboBoxItem, which is a view.
Since views can only have one parent, when
ComboBox.UpdateContentPresenter()sets its_contentPresenter.Contentto the SelectedItem, the parent of the item becomes that ContentPresenter, which explains why it's not in the dropdown list anymore.One option would be to implement in Uno the specifics of CarouselPanel that make the dropdown expand around the selected item (if we want the same behavior as UWP).
If you simply want to display strings in your ComboBox I suggest that you use the ItemsSource attribute instead of creating ComboBoxItems manually.
double28 commentedon Oct 17, 2018
In android,i can define a ItemTemplate of ComboBox,then the behaviour of ComboBox is well.
In IOS, it's not work still! I define a List as the ItemsSource value,it's still show nothing.
@jeromelaban ,do you know How to deal with it? Thank you!
XiaotianNetlift commentedon Dec 21, 2018
If you need to set the choices in xaml, you can use the primitives literals as a temporary workaround:
Using a list for
ItemsSourceshould work on both on ios & android. And, depending on what type of the list you get, you might need to set theDisplayMemberPath.Merge pull request unoplatform#87 from unoplatform/dev/madi/fix-card-…