-
Notifications
You must be signed in to change notification settings - Fork 711
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
First time clicking on Cut, Copy, Paste, Undo, or Select All menu items from TextCommandBarFlyout of a TextBox/TextBlock/PasswordBox makes the control lose focus #5818
Comments
I also confirmed this bug happens on other controls that use TextCommandBarFlyout, e.g. TextBlock, RichTextBlock, PasswordBox. RichEditBox does not have the bug. One workaround I found is to add:
before
|
I realized this happens on all the menu items in TextCommandBarFlyout. A more general workaround if you don't want to touch WinUI 2 code is in your app's code to hook into the TextCommandBarFlyout's Opening event and run this:
|
I found a related bug which I think is the same root cause: The first time you right click on a TextBox, if you hit escape, the TextBox doesn't get focused. If you try again it will get focused. |
@llongley Do you know whats going on here? Sounds vaguely familiar. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Likely still relevant |
Describe the bug
See title.
Steps to reproduce the bug
Steps to reproduce the behavior:
Expected behavior
Expected: "test" text in TextBox shows up as selected
Actual: "test" text is selected but it doesn't show as selected (Blue background) because the TextBox isn't focused. Subsequent clicks on "Select All" will correctly keep the TextBox focused.
Screenshots
Here's a video of the steps above showing the bug and how it works correctly the second time:
Screen.Recording.2021-09-01.at.11.37.58.AM.mov
Version Info
I'm on version 1.2.20.0 of XAML Controls Gallery.
Additional context
I also confirmed this issue happens when using TextCommandBarFlyout from WinUI version 2.7.0-prerelease.210816001 in a simple UWP app. Here's an example project demonstrating that: https://github.com/lyahdav/XamlPlayground/tree/text-box-with-win-ui-2-cbf
The text was updated successfully, but these errors were encountered: