TextBox ContextFlyout with custom options doesn't show if no text is in clipboard
See original GitHub issueDescribe the bug
When custom actions are added to the ContextFlyout
on the TextBox
control, the flyout quickly shows then disappears if there is no text in the clipboard and nothing in the Undo stack. Sometimes it doesn’t show at all.
Steps to reproduce the bug
- Have empty or non-text data in your clipboard.
- Right click in the TextBox
- ContextFlyout shows briefly then disappears
Expected behavior The flyout should show if there are custom actions like the code sample below. If there are no custom actions, the flyout should not show at all, even briefly.
Version Info NuGet package version: [Microsoft.UI.Xaml 2.4.2]
Windows 10 version | Saw the problem? |
---|---|
May 2020 Update (19041) | Yes |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Additional context Example code to reproduce the behavior in a new UWP app XAML:
<TextBox x:Name="tb" Loaded="tbloaded" Unloaded="tbunloaded"/>
C#:
private void tbloaded(object sender, RoutedEventArgs e)
{
tb.ContextFlyout.Opening += ContextFlyout_Opening;
}
private void tbunloaded(object sender, RoutedEventArgs e)
{
tb.ContextFlyout.Opening -= ContextFlyout_Opening;
}
private void ContextFlyout_Opening(object sender, object e)
{
var flyout = (sender as CommandBarFlyout);
flyout.PrimaryCommands.Add(new AppBarButton()
{
Command = new StandardUICommand(StandardUICommandKind.Close) //Just used as an example, doesn't matter what the UICommand is. Behavior is the same
});
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
TextBox Class (Windows.UI.Xaml.Controls) - UWP
Represents a control that can be used to display and edit plain text (single or multi-line).
Read more >c# - modifying TextBox context menu/MenuFlyout
1 Answer. The problem is that you have not give MenuFlyout instance to SelectionFlyout or ContextFlyout . Please refer the following code to ......
Read more >Why copying a text box in Adobe Acrobat XI Pro does not ...
When I editing the content of a PDF using Adobe Acrobat XI Pro, I noticed that when I copy a text box object,...
Read more >Uno support for user inputs
While the browser context menu enabled on TextBox and PasswordBox by default, it will be disabled when ContextFlyout is set on the control....
Read more >Filter Row in WinUI DataGrid control
Learn here all about Filter Row support in Syncfusion WinUI DataGrid(SfDataGrid) control with many filter options.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We don’t need to fix this in WinUI3. In WinUI3 we are using MUXC one.
Does the WinUI 3 use the MUXC contextflyout or is it using the WUXC one? Would you like me to create the tracking issue?