diff --git a/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs b/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs index 44a20c6cb416..b58c7cfd457f 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs @@ -123,7 +123,7 @@ internal virtual void OnSelectedItemChanged(object oldSelectedItem, object selec var wasSelectionUnset = oldSelectedItem == null && (!GetItems()?.Contains(null) ?? false); var isSelectionUnset = false; var items = GetItems(); - if (!items?.Contains(selectedItem) ?? false) + if ((!items?.Contains(selectedItem) ?? false) && !AreCustomValuesAllowed()) { if (selectedItem == null) { @@ -415,7 +415,7 @@ private static object SelectedValueCoerce(DependencyObject snd, object baseValue { return baseValue; // Setting the SelectedValue won't update the index when a _path is used. } - return selector.GetItems()?.Contains(baseValue) ?? false ? baseValue : null; + return (selector.GetItems()?.Contains(baseValue) ?? false) || selector.AreCustomValuesAllowed() ? baseValue : null; } public bool? IsSynchronizedWithCurrentItem