Skip to content

Commit

Permalink
fix: Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
workgroupengineering committed Aug 12, 2024
1 parent 122b204 commit 0d7ee20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Avalonia.Controls/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ protected override void OnKeyDown(KeyEventArgs e)
break;
case Key.Space:
// Handle Space only current focus control
if (TopLevel.GetTopLevel(this)?.FocusManager?.GetFocusedElement() == this)
if (IsFocused)
{
if (ClickMode == ClickMode.Press)
{
Expand All @@ -314,7 +314,7 @@ protected override void OnKeyDown(KeyEventArgs e)
protected override void OnKeyUp(KeyEventArgs e)
{
// Handle Space only current focus control
if (e.Key == Key.Space && TopLevel.GetTopLevel(this)?.FocusManager?.GetFocusedElement() == this)
if (e.Key == Key.Space && IsFocused)
{
if (ClickMode == ClickMode.Release)
{
Expand Down

0 comments on commit 0d7ee20

Please sign in to comment.