[UWP] TextBox does not accept any key inputs after a text pasted

AllenLynx8 1 Reputation point
2020-10-20T03:28:43.503+00:00

I have discovered a weird issue in UWP app and I can reproduce it consistently with the following steps:

  • A test app has two TextBox inputs on the page. For example: textBox1 and textBox2 with some texts.
  • Set focus to textBox1 and cursor is in textBox1
  • open a text editor or any app with text you can copy from and the test app is not overlapped with the app you are switched to
  • copy any text from the other app and pasted it to textBox2 directly. The trick is that you don't click in the textBox2 first, then paste the text. You need to do the following:
    • Press and hold on the mouse's left key, and highlight whole text in textBox2. Then press Ctrl+v to paste the text.
    • Mouse right click on textBox2 and select "Paste" from the context menu to paste text
  • After the text is pasted to textBox2, you can only delete the characters, but can no longer enter any character.
  • Switching focus away and back to textBox2 will resume the text input.

I have added KeyDown event handler to log key events and see KeyDown events are received when the TextBox cannot add any entered keys.

I can also reproduce this issue with the ContactCards sample project form UWP samples (https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/ContactCards).

Is this a known issue? Is there any workaround to fix the text input?

Thanks in advance.

Allen

Universal Windows Platform (UWP)
{count} votes