MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

MaterialDesignEmbeddedDialogHost and focus on open

Open
#1,818 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug evaluation required
Dominant language
C#
Stars
16.3k
Forks
3.5k
Avg merge
1d 22h
Merged PRs (30d)
8

Description

When using DialogHost in a Style="{StaticResource MaterialDesignEmbeddedDialogHost}" configuration, then when opening, the focus for the first focusable control doesn't seem quite right.
It can be replicated using dialoghost Sample 2 "pass view".

If I use the embedded version, then nothing seems to have focus.
If I add FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}" to the first button in embedded a dialoghost:
image
However I can't just hit enter on that button and there's no dashed lines in the button like this either:
image
Which seems related to it setting logical focus, but not physical focus: https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/focus-overview#logical-focus

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with DialogHost Sample 2, “pass view,” using the MaterialDesignEmbeddedDialogHost style. Compare focus behavior when opening the embedded dialog, including keyboard activation and the visible focus indicator; done means the first focusable control receives physical focus and Enter activates it.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.