Skip to content

FocusAdorner remains after the element has been hidden #18817

Closed
@impworks

Description

@impworks

Describe the bug

When using tab navigation and pressing the button that hides its container (e.g. a dialog box), the focus adorner remains.

Image

Image

To Reproduce

  1. Download the minirepro source:
    https://github.com/impworks/avalonia-focus-bug-repro

  2. Start the app

  3. Click the "Open" button

  4. Press "Tab" until the "Close" button is in focus

  5. Press "Space" to close the dialog

Expected behavior

Focus adorner disappears when the element is hidden

Avalonia version

11.3.0

OS

Windows

Additional context

There is a temporary workaround to use FocusManager.ClearFocus in the Close command.
However, this method is marked as [Obsolete] and cannot be safely used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions