question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextBox ContextFlyout with custom options doesn't show if no text is in clipboard

See original GitHub issue

Describe 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

  1. Have empty or non-text data in your clipboard.
  2. Right click in the TextBox
  3. 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:closed
  • Created 3 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ranjeshjcommented, Jul 31, 2020

We don’t need to fix this in WinUI3. In WinUI3 we are using MUXC one.

0reactions
chingucodingcommented, Jul 31, 2020

Does the WinUI 3 use the MUXC contextflyout or is it using the WUXC one? Would you like me to create the tracking issue?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found