-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CommandBarFlyout keyboard navigation broken on RNW Islands app #8306
Comments
Let's reproduce this behavior in an RNW islands app and debug through what's going wrong. |
@rozele I'm not seeing the the 'Proofing' command, and the secondary sub-menu: did you customize the textbox in some way? @asklar suggested it might be due to playground-win32 now running with the new WinUI progress ring, which your repro might not have included, but I still can't repro after checking out the repo at the point before that change was made. |
Did you set the TextInput spellCheck property to true? It's from:
But I'm pretty sure this issue repros for Eric even if there is no Proofing submenu. Are you able to navigate that context menu with keyboard? |
@rectified95 - I did not customize the TextBox. Did you force a typo into the TextBox? I still see the Proofing menu on latest main branch in Playground-win32 |
I was finally able to repro this consistently, but I don't know what changed that led to the bug starting to appear (I did not upgrade Windows 10 version). But, I was then able to root cause it. The issue seems to happen only to some users (not specific version of Windows 10). And I can fix the issue if I comment out this code in Application.manifest which sets So I think this is actually a XAML bug, not RNW. But I noticed that when I created an Islands app from the VS template it didn't have that |
Now I know why the issue started happening to me. I started using a different monitor. Makes sense as this is a per-monitor DPI setting. |
I was curious about other values for
|
I have tested playground win32 on my single 1080p monitor with no DPI scaling. If I right-click on the text box, and there is only 1 item in the list (Paste), pressing up/down on the keyboard does not work to focus the item. If there are two or more items (there was text in the text box giving Paste/Cut/Copy, or I typed and deleted text giving Paste/Undo), pressing up does nothing while pressing down always selects the 2nd item, not the first. Using a context-menu button on my keyboard, keyboard navigation works properly in all cases as the first item is immediately highlighted. |
@jonthysell can you try with DPI scaling? And also this bug is only present when there are multiple menu items. I think it's expected behavior that pressing down selects the 2nd item. When the bug happens even that doesn't work. |
@lyahdav well, it would make sense that pressing down selected the second item, if the first item was actually selected. nothing is visibly selected when using right-click, though the first item is when using the context-menu button. so there's still problems even without DPI scaling. |
Using CommandBarFlyout from WinUI 2 (tested with version 2.6.1-prerelease.210709001) fixes this issue but leads to a crash when the flyout is closed. Here's a fork with that change: https://github.com/lyahdav/react-native-windows/tree/win-ui-2-cbf |
Here's a branch with a workaround for the crash I mentioned in previous comment: https://github.com/lyahdav/react-native-windows/tree/win-ui-2-cbf-with-crash-on-flyout-closing-fix
Also for posterity, here's the crash exception info:
And call stack:
|
This seems to have been fixed by switching to the WinUI CommandBarFlyout and the "new" crash was fixed in 2.7 prerelease. Do we want to switch to WinUI for the flyout as per this change: lyahdav@a36d84c |
This fixes the broken keyboard navigation in an islands app, however it can cause a crash when using WinUI 2.6 (but is fixed in WinUI 2.7). Closes microsoft#8306
Seeing as we just upgraded to WinUI 2.6 for RNW 0.66, which is already in preview and almost ready, I think it's a little late to jump again to 2.7 without more testing. @chrisglein can you move this to 0.67 if you agree? |
@jonthysell I think we should switch to the WinUI 2 CommandBarFlyout for Text and TextInput context menu to fix this bug. I was eventually going to PR this, but it might not be for a while, in case someone else can get to it sooner. |
Do you mean like this? I started this PR here based on what you did: #8723 I'm also working on a PR to upgrade us from MUX 2.6 to 2.7, but that might not make RNW 0.66. |
@jonthysell yes, and as you said in that PR, you should wait until the MUX 2.7 upgrade before landing it. |
Agreed. It seems too late to switch from 2.6 to 2.7. Let's target that jump for 0.67 so we can ensure it's stable. In the meantime any individual app can bump to 2.7 on their own. |
This fixes the broken keyboard navigation in an islands app, however it can cause a crash when using WinUI 2.6 (but is fixed in WinUI 2.7, which was just checked in). Closes #8306 Co-authored-by: Liron Yahdav <lyahdav@users.noreply.github.com>
…nu (microsoft#8723) This fixes the broken keyboard navigation in an islands app, however it can cause a crash when using WinUI 2.6 (but is fixed in WinUI 2.7, which was just checked in). Closes microsoft#8306 Co-authored-by: Liron Yahdav <lyahdav@users.noreply.github.com>
…nu (#8723) (#8944) This fixes the broken keyboard navigation in an islands app, however it can cause a crash when using WinUI 2.6 (but is fixed in WinUI 2.7, which was just checked in). Closes #8306 Co-authored-by: Liron Yahdav <lyahdav@users.noreply.github.com> Co-authored-by: Liron Yahdav <lyahdav@users.noreply.github.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com>
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
I should be able to use the arrow keys or tab to navigate through context menu items.
Notes
I considered filing this bug on the microsoft/microsoft-ui-xaml repo, but I am only able to reproduce the issue on react-native-windows.
Snack, code example, screenshot, or link to a repository:
In the video below, pressing Up/Down arrow keys does not allow navigation through the CommandBarFlyout items
2021-07-22.12-39-59.mp4
For context, here is the CommandBarFlyout working in a "standard" XAML Islands app:
2021-07-22.12-39-22.mp4
The text was updated successfully, but these errors were encountered: