feat: try to focus on dialog and make tab navigation cycled.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.VisualTree;
|
||||
using Irihi.Avalonia.Shared.Helpers;
|
||||
using Irihi.Avalonia.Shared.Shapes;
|
||||
using Ursa.Controls.OverlayShared;
|
||||
@@ -170,6 +171,9 @@ public partial class OverlayDialogHost
|
||||
{
|
||||
_maskAppearAnimation.RunAsync(mask);
|
||||
}
|
||||
|
||||
var element = control.GetVisualDescendants().OfType<InputElement>().FirstOrDefault(a => a.Focusable);
|
||||
element?.Focus();
|
||||
_modalCount++;
|
||||
IsInModalStatus = _modalCount > 0;
|
||||
control.IsClosed = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class OverlayFeedbackElement: ContentControl
|
||||
|
||||
static OverlayFeedbackElement()
|
||||
{
|
||||
FocusableProperty.OverrideDefaultValue<OverlayFeedbackElement>(true);
|
||||
FocusableProperty.OverrideDefaultValue<OverlayFeedbackElement>(false);
|
||||
DataContextProperty.Changed.AddClassHandler<OverlayFeedbackElement, object?>((o, e) => o.OnDataContextChange(e));
|
||||
ClosedEvent.AddClassHandler<OverlayFeedbackElement>((o,e)=>o.OnClosed(e));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user