Skip to content

Commit

Permalink
Layout OverlayPopupHost content for focus to work
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJul committed Oct 22, 2024
1 parent d48fcff commit 1b4df78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Avalonia.Controls/Primitives/OverlayPopupHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ bool IInputRoot.ShowAccessKeys
public void Show()
{
_overlayLayer.Children.Add(this);

if (Content is Visual { IsAttachedToVisualTree: false })
{
// We need to force a measure pass so any descendants are built, for focus to work.
UpdateLayout();
}
}

/// <inheritdoc />
Expand Down

0 comments on commit 1b4df78

Please sign in to comment.