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

Using AccessKey to Close Window Causes Exception #9002

Closed
johnt-star opened this issue Oct 18, 2023 · 1 comment
Closed

Using AccessKey to Close Window Causes Exception #9002

johnt-star opened this issue Oct 18, 2023 · 1 comment
Labels
area-AccessKeys bug Something isn't working team-Controls Issue for the Controls team
Milestone

Comments

@johnt-star
Copy link

Describe the bug

If a button is used to close a window, everything works as expected.

However, if an AccessKey is assigned to the button, then the AccessKey is invoked to close the window, an exception occurs.
Exception

Steps to reproduce the bug

AccessKey.zip

Project file included to demonstrate issue.

  1. In main window, add a button that when tapped, launches a second window.
  2. In second window, add a button that when tapped, closes the second window.
  3. In second window, add an AccessKey for the button, that when invoked, also closes the second window.

Expected behavior

Using AccessKey to close window should not cause exception and should work the same way as tapping corresponding button.

Screenshots

MainWindow
MainWindowXaml
SecondWindow

Some code screen shots - project attached in zip file

NuGet package version

Windows App SDK 1.4.2: 1.4.231008000

Packaging type

No response

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

@bpulliam bpulliam transferred this issue from microsoft/WindowsAppSDK Oct 19, 2023
@duncanmacmichael duncanmacmichael added the bug Something isn't working label Oct 23, 2023
@bpulliam bpulliam added the team-Controls Issue for the Controls team label Jan 22, 2024
@JJBrychell JJBrychell added the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Jan 26, 2024
@JJBrychell
Copy link

After and access key is triggered, we will sometimes attempt to reset focus, but if the page is destruction, things can get confused.

The fix is in and scheduled for 1.5.

@bpulliam bpulliam added this to the WinAppSDK 1.5 milestone Feb 29, 2024
@bpulliam bpulliam removed the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AccessKeys bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants