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.

Mouse right-click in TextBox crashes the application

See original GitHub issue

Describe the bug Mouse right-click in TextBox crashes the application.

Steps to reproduce the bug

  • Create new WinUI 3 in Desktop project.
  • Add a TextBox to MainWindow.xaml
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
        <TextBox/>
    </StackPanel>
  • Run the application
  • Right-click with the mouse pointer inside the TextBox

Expected behavior

Application doesn’t crash.

Screenshots

Version Info

NuGet package version:

WinUI 3 - Project Reunion 0.5: 0.5.0

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:30 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
marwalschcommented, Jun 9, 2022

The exception is not thrown when a context menu is provided. As a workaround it can be defined and immediately closed when opening.

<TextBox>
    <TextBox.ContextFlyout>
        <Flyout Opening="OnFlyoutOpening"/>
    </TextBox.ContextFlyout>
</TextBox>

private void OnFlyoutOpening(object sender, object _)
{
    if(sender is Flyout f)
    {
        f.Hide();
    }
}
1reaction
nCastle1commented, Dec 16, 2021

This is still an issue with the released version. I’m using the latest released windows app sdk and build tools that I could get working.

image

The only difference is the textbox needs to have text in it; it no longer repros when it starts empty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF application get crashed on pressing right mouse button
Actually i have problem with my wpf application, when ever i press right mouse button on the running application it stuck and gets...
Read more >
Application sometimes freezes when user perform a mouse ...
Hello, I have a random problem that I cannot reproduce. Sometimes when users perform a mouse right click on a devexpress control (usually...
Read more >
discord crashing(?) when right clicking on the text box
ever since this new update discord sorta just crashes when i right click on the text box. sometimes it doesnt and sometimes it...
Read more >
Windows Search keeps crashing as soon as I click the text ...
Opening the Search feature through the Start Menu right-click will cause the search window to appear for a second before it crashes/immediately ...
Read more >
Right-click causes application crash - Ask Different
I have a serious problem with right clicking. When ever I try to open the contextual menu in certain applications like the iWork...
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