Open modula2019 opened 2 months ago
Checked your repro, indeed there is a bug.
It seems that the ComboBox
is not un-selecting previous item when selection changes so we end to have more than on item selected and your SelectedPerson
will remain stick to the first selected item.
Putting this issue into our backlog.
Thanks for the reply. Your suggestion works while we wait for permanent solution
ComboBox doesn't support ISelectionInfo on Windows. The team needs to fix the support of ICollectionView on Uno Platform Apps.
@modula2019 @dr1rrb
Here is more details about the next steps:
ICollectionView
in MVUX works properly with the ComboBox
(i.e. replace single select item and )ICollectionView
AND the ISelectionInfo
(still in MVUX) for controls likes ListView
on windowsComboBox
on Uno is properly align with windows for bothe ISelectionInfo
and ICollectionView
. Note: If needed we will remove the support of the ISelectionInfo
frm the ComboxBox
in uno, but if possible we will keep it.Hey @modula2019, the workaround I provided was an evolution of my investigation to understand what was the issue. It has the advantage to not alter the code of your app and can be just removed once the bug is going to be fixed. But a simpler workaround would be to remove the .Selection(SelectedPerson)
from the IListState<Person> People
and then add a binding on the ComboBox.SelectedItem={Binding SelectedPerson.Value, Mode=TwoWay}
.
Note: The
.Value
is needed to be able to set an instance ofPeople
as for the binding the entity is exposed de-normalized to be able to edit each property of thePerson
individually, like<TextBox Text="{SelectedPerson.FirstName, Mode=TwoWay}" />
.
Hey @modula2019, the workaround I provided was an evolution of my investigation to understand what was the issue. It has the advantage to not alter the code of your app and can be just removed once the bug is going to be fixed. But a simpler workaround would be to remove the
.Selection(SelectedPerson)
from theIListState<Person> People
and then add a binding on theComboBox.SelectedItem={Binding SelectedPerson.Value, Mode=TwoWay}
.Note: The
.Value
is needed to be able to set an instance ofPeople
as for the binding the entity is exposed de-normalized to be able to edit each property of thePerson
individually, like<TextBox Text="{SelectedPerson.FirstName, Mode=TwoWay}" />
.
@dr1rrb Thanks, this makes it much easier. The workaround worked perfectly. Thanks once again
https://github.com/unoplatform/uno/pull/17582 needs to be done as well to be able to close this issue
Current behavior
I am following the instructions in the documentation below to implement selection in a combobox. I discover that combobox is able to identify item firstly selected and the items above it. The items below the firstly selected item are ignored. I see this as a bug because this is not what it is intended to do.
https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Mvux/Advanced/Selection.html#implement-selection-in-the-peopleapp
Expected behavior
The expected behaviour should be to identify every selection when it is made.
How to reproduce it (as minimally and precisely as possible)
UnoApp1.zip
A sample repo is attached here to check the behavior. The ComboBoxPage.xaml is the affected page
Environment
Nuget Package (s):
Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
Anything else we need to know?
None. Everything needed is already supplied