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.

Unable to Enter Text into TextBox inside ContentDialog in WinUI3 Desktop

See original GitHub issue

Describe the bug

In WinUI3 Desktop, we are unable to type in text into the TextBoxes inside ContentDialogs with some exceptions.

More detailed observations and debugging below in the “Additional Context” section.

Steps to reproduce the bug

  1. Clone our WinUI3 Problems TextBox repository.
  2. Go to the TextBoxWinUI folder.
  3. Open the TextBoxWinUI solution.
  4. Build and run with Debug x64.
  5. Once the application is loaded, click the “Click me” button.
  6. Without clicking or clicking away from or outside of the application window, start typing into the TextBox.
  7. No characters should appear - unless actions described in the “Additional context” are performed.

Expected behavior

We expect text to appear within the textbox when typing. We expect to see the same behavior we saw in UWP.

Build and run the TextBoxUWP solution inside the TextBoxUWP folder to see expected behavior.

Screenshots

TextBoxCurrentBehavior

Screenshot#1 - TextBox inside ContentDialog

Version Info

NuGet package version: [Microsoft.VCRTForwarders.140 1.0.6] [Microsoft.WinUI 3.0.0-preview1.200515.3]

Targeting: Target: Universal Windows Target version: Windows 10, version 1809 (10.0; Build 17763) Min version: Windows 10, version 1809 (10.0; Build 17763)

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

Additional context

  • When trying to type into the TextBox immediately, no characters appear.

  • When trying to type quickly with many characters into the TextBox immediately, the text cursor seems to freeze up and not blink.

  • However, after clicking away from or outside of the application window, we are able to type in a subset of characters into the TextBox. This subset includes:

    • These characters which use the same 5 keys with and without the shift key: []{}'"|`~
    • Backspace key works.
    • Characters created using the Alt key and numeric keypad (e.g. Alt-65 for “A”).
    • Characters copied from elsewhere can be pasted into the TextBox.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
anawishnoffcommented, Jan 25, 2021

@smj389, @crramirez It looks like this bug will be fixed in the next release of WinUI 3.

2reactions
dynamiquelcommented, Jul 19, 2020

I’m having the same issue, is there no workaround? My app depends on ContentDialogs with text boxes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# WinUI 3 - How do I reference a textbox in a ContentDialog
You can just create a method to get data from the content page. For example: ContentDialogPage.xaml <Page x:Class="ContentDialogExample.
Read more >
ContentDialog Class (Microsoft.UI.Xaml.Controls)
Represents a dialog box that can be customized to contain checkboxes, hyperlinks, buttons and any other XAML content.
Read more >
ContentDialog Class (Windows.UI.Xaml.Controls)
Represents a dialog box that can be customized to contain checkboxes, hyperlinks, buttons and any other XAML content.
Read more >
Microsoft release Windows UI Library 3 Preview 4
... TreeViewNodes crashes; WinUI 3 Desktop: Unable to Enter Text into TextBox inside ContentDialog; WinUI 3 Desktop: ALT and F6 don't work ...
Read more >
WinUI 3 Preview 4 is available
WinUI 3 Desktop : Unable to Enter Text into TextBox inside ContentDialog; WinUI 3 Desktop: ALT and F6 don't work; Old removed SwapChainPanel ......
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