Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/Views/PopupDataTemplates.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Avalonia.Controls;
using System.Linq;

using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.VisualTree;
Expand Down Expand Up @@ -35,6 +37,22 @@ public Control Build(object param)
return;
}
}

var host = ctl.GetVisualAncestors().OfType<Control>().FirstOrDefault(c => c.Name == "PopupPanel");
if (host == null)
return;

foreach (var input in host.GetVisualDescendants())
{
if (input is SelectableTextBlock)
continue;

if (input is Control { Focusable: true, IsVisible: true, IsEffectivelyVisible: true, IsEffectivelyEnabled: true } focusable)
{
focusable.Focus(NavigationMethod.Directional);
return;
}
}
};

return control;
Expand Down