Skip to content

Commit

Permalink
Merge pull request #18483 from unoplatform/mergify/bp/release/stable/…
Browse files Browse the repository at this point in the history
…5.5/pr-18470

fix: Workaround non-UIElement UIViews in Grid layout (backport #18470)
  • Loading branch information
jeromelaban authored Oct 16, 2024
2 parents 6c0b8fc + bf072f8 commit 2e23f1c
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 2e23f1c

Please sign in to comment.