Skip to content

Commit

Permalink
fix: Workaround non-UIElement UIViews in Grid layout
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Oct 15, 2024
1 parent 12c7e46 commit bc73f58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/Grid/Grid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bc73f58

Please sign in to comment.