diff --git a/src/Uno.UI/UI/Xaml/Controls/Grid/Grid.cs b/src/Uno.UI/UI/Xaml/Controls/Grid/Grid.cs index a170e018fd64..bb40c2c87e88 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Grid/Grid.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Grid/Grid.cs @@ -1374,6 +1374,12 @@ private XSIZEF InnerArrangeOverride(XSIZEF finalSize) while (childrenEnumerator.MoveNext()) { var currentChild = childrenEnumerator.Current; +#if __IOS__ // Uno specific: On iOS an additional non-UIElement is added the the parent of a focused TextBox control, we need to skip it. + if (currentChild is null) + { + continue; + } +#endif ASSERT(currentChild is { }); currentChild.EnsureLayoutStorage(); @@ -1414,6 +1420,12 @@ private XSIZEF InnerArrangeOverride(XSIZEF finalSize) for (Xuint childIndex = 0; childIndex < count; childIndex++) { UIElement currentChild = children[childIndex]; +#if __IOS__ // Uno specific: On iOS an additional non-UIElement is added the the parent of a focused TextBox control, we need to skip it. + if (currentChild is null) + { + continue; + } +#endif ASSERT(currentChild is { }); DefinitionBase row = GetRowNoRef(currentChild);