none
[UWP]TextBox Text White upon Deletion

    Question

  • In our enterprise application, we've encountered the following issue with UWP XAML textboxes and are in search of a workaround or solution. To reproduce:

    1. Add a XAML Texbox to a page in an application. See a simple version here. The textbox should allow wrapping and AcceptReturn. See: <TextBox x:Name="TextBox" Height="500" Width="300" AcceptsReturn="True"  TextWrapping="Wrap" />
    2. Add enough text to the textbox that it is required to scroll. 
    3. Delete some of the text at the end of the box, which makes the TexBox control scroll upwards.
    4. Note that the text is now white. See GIF below for clarity.


    Monday, June 10, 2019 5:12 PM

Answers

  • Hi,

    I was testing this in Build 1903 yesterday. Currently I test it in build 1809 and I could reproduce the problem. I will report this issue to the team. Thank you for reporting this here.

    A workaround is to select all the test and deselect them after the text is changed in the textchanged event. Like this:

     private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
            {
                tBox.SelectAll();
                tBox.Select(0,0);
            }

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Ezra Ward Wednesday, June 12, 2019 1:59 PM
    Wednesday, June 12, 2019 9:29 AM
    Moderator

All replies

  • Also, to add to this post, we originally thought it was due to something custom in our textboxes or even our the styles that we apply to the textbox. That's why we created the dead simple sample code that exhibits the problem pretty well.
    Monday, June 10, 2019 10:40 PM
  • Hi,

    I created an blank app in my side and your code snippet to test. But your code works well in my side. Like this:

    Since I could not reproduce your problem, I have some questions here. What's the OS version of your device and target version of your app? Does this behavior happens every time or it happens randomly? Does this only happens to one device or it happens to all devices? 

    The sample you give is not able to reproduce the problem. Could you please try to create a new blank app and put your code in, then reproduce it and share the project with me?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 11, 2019 6:48 AM
    Moderator
  • The target version of our app is Windows 10 build 17763, v1809. To create this demonstration of the issue, we were using Windows 10 v1809. This morning I remoted debugged the sample app(I did not change the targeted version of Windows.) against Windows 10 v1809, and v1903. Only v1809 exhibited the issue.

    This leads me to believe it's an issue/bug in v1809. Any thoughts on this conclusion?

    Tuesday, June 11, 2019 5:44 PM
  • Hi,

    I was testing this in Build 1903 yesterday. Currently I test it in build 1809 and I could reproduce the problem. I will report this issue to the team. Thank you for reporting this here.

    A workaround is to select all the test and deselect them after the text is changed in the textchanged event. Like this:

     private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
            {
                tBox.SelectAll();
                tBox.Select(0,0);
            }

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Ezra Ward Wednesday, June 12, 2019 1:59 PM
    Wednesday, June 12, 2019 9:29 AM
    Moderator
  • Thank you for reporting, and thanks for the answer!
    Wednesday, June 12, 2019 1:59 PM
  • Hello Ezra,

    Our engineering team are still working on this issue, I will update here once there is any update.
    Another workaround is to use the RichEditBox for instead in build 1809.

    Thanks for your patience.

    Thanks,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 19, 2019 8:43 AM
    Owner