|
|
@ -199,7 +199,6 @@ namespace Avalonia.Input |
|
|
private bool _isFocusVisible; |
|
|
private bool _isFocusVisible; |
|
|
private bool _isPointerOver; |
|
|
private bool _isPointerOver; |
|
|
private GestureRecognizerCollection? _gestureRecognizers; |
|
|
private GestureRecognizerCollection? _gestureRecognizers; |
|
|
private bool _restoreFocus; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Initializes static members of the <see cref="InputElement"/> class.
|
|
|
/// Initializes static members of the <see cref="InputElement"/> class.
|
|
|
@ -444,21 +443,9 @@ namespace Avalonia.Input |
|
|
SetAndRaise(IsEffectivelyEnabledProperty, ref _isEffectivelyEnabled, value); |
|
|
SetAndRaise(IsEffectivelyEnabledProperty, ref _isEffectivelyEnabled, value); |
|
|
PseudoClasses.Set(":disabled", !value); |
|
|
PseudoClasses.Set(":disabled", !value); |
|
|
|
|
|
|
|
|
if (!IsEffectivelyEnabled) |
|
|
if (!IsEffectivelyEnabled && FocusManager.Instance?.Current == this) |
|
|
{ |
|
|
{ |
|
|
if (FocusManager.Instance?.Current == this) |
|
|
FocusManager.Instance?.Focus(null); |
|
|
{ |
|
|
|
|
|
_restoreFocus = true; |
|
|
|
|
|
FocusManager.Instance?.Focus(null); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_restoreFocus = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else if (IsEffectivelyEnabled && _restoreFocus) |
|
|
|
|
|
{ |
|
|
|
|
|
FocusManager.Instance?.Focus(this); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|