You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After navigating to any interface and once the interface gains focus, I've noticed that the KeyDown event (a bubbling event) often fails to trigger. This issue primarily affects the arrow keys: Up, Down, Left, and Right. I suspect this may be due to the PreviewKeyDown event (a tunneling event) being handled prematurely, which prevents the bubbling KeyDown event from being properly triggered.
To Reproduce
Steps to Reproduce
Step 1: Add tunneling and bubbling key event subscriptions in the main window constructor:
Step 2: Start the application and without performing any actions, test key presses. The output is as follows:
21:05:06:923 OnPreviewKeyDown Up
21:05:06:923 OnKeyDown Up
21:05:07:169 OnPreviewKeyDown Down
21:05:07:169 OnKeyDown Down
21:05:07:416 OnPreviewKeyDown Left
21:05:07:416 OnKeyDown Left
21:05:07:416 OnPreviewKeyDown Right
21:05:07:416 OnKeyDown Right
Step 3: Click any menu item in the navigation bar (e.g., Base Input) so that the focus moves to the navigation bar. Press the keys again and observe the output:
21:08:04:890 OnPreviewKeyDown Up
21:08:05:639 OnPreviewKeyDown Down
21:08:05:889 OnPreviewKeyDown Left
21:08:06:141 OnPreviewKeyDown Right
Step 4: Click on the first gallery navigation item Anchor and press the keys again. The output is as follows:
21:11:16:533 OnPreviewKeyDown Up
21:11:16:533 OnKeyDown Up
21:11:16:777 OnPreviewKeyDown Down
21:11:16:777 OnKeyDown Down
21:11:16:777 OnPreviewKeyDown Left
21:11:16:777 OnKeyDown Left
21:11:17:029 OnPreviewKeyDown Right
21:11:17:029 OnKeyDown Right
Step 5 (Critical Step): Click any element on this page to gain focus (e.g., expand the source code), then press the keys again. The output is as follows:
21:12:57:145 OnPreviewKeyDown Up
21:12:57:391 OnPreviewKeyDown Down
21:12:57:391 OnPreviewKeyDown Left
21:12:57:637 OnPreviewKeyDown Right
However, other keys can still trigger the bubbling event:
21:14:23:389 OnPreviewKeyDown Up
21:14:23:639 OnPreviewKeyDown Down
21:14:23:889 OnPreviewKeyDown Left
21:14:23:889 OnPreviewKeyDown Right
21:14:25:640 OnPreviewKeyDown A
21:14:25:640 OnKeyDown A
21:14:26:387 OnPreviewKeyDown B
21:14:26:387 OnKeyDown B
21:14:26:639 OnPreviewKeyDown C
21:14:26:639 OnKeyDown C
Expected behavior
Please avoid handling key events directly in the tunneling event, as this can prevent text editors on the page from properly handling cursor movement and can also disrupt key event propagation for the WebView2 control. This behavior may negatively impact keyboard-based user interactions and reduce overall user experience.
Moreover, when I created a new window and moved the page content to this new window, the text editor’s cursor movement function worked correctly, and the WebView2 control could receive key events. This proves that the previously described issue does not occur in the new window, confirming that the bug originates from the navigation bar.
Screenshots
No response
OS version
Edition: Windows 11 Pro
Version: 23H2
Installation Date: February 29, 2024
OS Build: 22631.4317
Experience: Windows Feature Experience Pack 1000.22700.1041.0
.NET version
.NET 8.0
WPF-UI NuGet version
Version: 3.0.5, and the testing was conducted using the source code repository cloned two days ago, with the same issue observed.
Additional context
It should not be related to <ui:NavigationView.AutoSuggestBox>, as it was removed and tested without it.
The text was updated successfully, but these errors were encountered:
Describe the bug
After navigating to any interface and once the interface gains focus, I've noticed that the KeyDown event (a bubbling event) often fails to trigger. This issue primarily affects the arrow keys: Up, Down, Left, and Right. I suspect this may be due to the PreviewKeyDown event (a tunneling event) being handled prematurely, which prevents the bubbling KeyDown event from being properly triggered.
To Reproduce
Steps to Reproduce
Step 1: Add tunneling and bubbling key event subscriptions in the main window constructor:
Step 2: Start the application and without performing any actions, test key presses. The output is as follows:
Step 3: Click any menu item in the navigation bar (e.g., Base Input) so that the focus moves to the navigation bar. Press the keys again and observe the output:
Step 4: Click on the first gallery navigation item Anchor and press the keys again. The output is as follows:
Step 5 (Critical Step): Click any element on this page to gain focus (e.g., expand the source code), then press the keys again. The output is as follows:
However, other keys can still trigger the bubbling event:
Expected behavior
Please avoid handling key events directly in the tunneling event, as this can prevent text editors on the page from properly handling cursor movement and can also disrupt key event propagation for the WebView2 control. This behavior may negatively impact keyboard-based user interactions and reduce overall user experience.
Moreover, when I created a new window and moved the page content to this new window, the text editor’s cursor movement function worked correctly, and the WebView2 control could receive key events. This proves that the previously described issue does not occur in the new window, confirming that the bug originates from the navigation bar.
Screenshots
No response
OS version
Edition: Windows 11 Pro
Version: 23H2
Installation Date: February 29, 2024
OS Build: 22631.4317
Experience: Windows Feature Experience Pack 1000.22700.1041.0
.NET version
.NET 8.0
WPF-UI NuGet version
Version: 3.0.5, and the testing was conducted using the source code repository cloned two days ago, with the same issue observed.
Additional context
It should not be related to
<ui:NavigationView.AutoSuggestBox>
, as it was removed and tested without it.The text was updated successfully, but these errors were encountered: