Skip to content

fix: keyboard focus does not return to previous element after closing FluentDialog #4094

@adamint

Description

@adamint

🐛 Bug Report

As in title, keyboard focus should be placed back on the element focused before the dialog was opened after it has been closed. This is apparent when triggering dialog open using the keyboard (with enter).

💻 Repro or Code Sample

Can be reproduced in any of the FluentDialog examples -> https://www.fluentui-blazor.net/Dialog

💁 Possible Solution

Save a reference to the element currently focused during dialog open, in the dialog service. Focus it again during close.

I will follow up with a fix tomorrow.

🔦 Context

dotnet/aspire#10119

Metadata

Metadata

Assignees

No one assigned

    Labels

    community:contributionIssue will/can be addressed by community contribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions