Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Initial control is not focused #8816

Closed
BreeceW opened this issue Sep 2, 2023 · 1 comment
Closed

Regression: Initial control is not focused #8816

BreeceW opened this issue Sep 2, 2023 · 1 comment
Labels
area-XamlWindow bug Something isn't working fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. team-Reach Issue for the Reach team
Milestone

Comments

@BreeceW
Copy link
Contributor

BreeceW commented Sep 2, 2023

Describe the bug

WinUI 3 on Windows App SDK 1.4 does not focus the initial control in a window by default. In previous releases, the control with the lowest TabIndex would automatically get focus. Now the user must tab once before they can do anything useful with the keyboard.

Steps to reproduce the bug

  1. Create a new WinUI 3 app with the Visual Studio template and update to Windows App SDK 1.4
  2. The default template should have included a button and a clicked handler that changes the button’s text
  3. Run the app
  4. Press the space key. This should have triggered the button click and changed the button’s text from “Click Me” to “Clicked” but it does not
  5. Press the tab key and then press space. Now the button has been “clicked.”

Expected behavior

The button (generally, the control with the lowest TabIndex) should be focused automatically when the window opens, instead of having to tab to it first.

NuGet package version

WinUI 3 - Windows App SDK 1.4.0: 1.4.230822000

Windows version

Windows 11 (22H2): Build 22621

Additional context

Interestingly, if the window is deactivated immediately after it opens (i.e., user selects a different window) and then returns to the window (even without clicking inside the window content area), the correct control will become focused.

@BreeceW BreeceW added the bug Something isn't working label Sep 2, 2023
@bpulliam bpulliam added area-FocusManager Focus APIs such as Control.Focus(), FocusManager.Try[Move]Focus[Async], keyboarding with [shift+]tab team-Reach Issue for the Reach team labels Sep 7, 2023
@JesseCol JesseCol added area-XamlWindow and removed area-FocusManager Focus APIs such as Control.Focus(), FocusManager.Try[Move]Focus[Async], keyboarding with [shift+]tab labels Dec 9, 2023
@pratikone pratikone added the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Apr 30, 2024
@pratikone
Copy link
Contributor

Found and fixed the issue. Closing now. should be available in next winappsdk minor release like 1.6

@codendone codendone added this to the WinAppSDK 1.6 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-XamlWindow bug Something isn't working fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. team-Reach Issue for the Reach team
Projects
None yet
Development

No branches or pull requests

5 participants