4

We have a Uwp app with a lot of text boxes. Recently we noticed that after typing a few characters on a touch device, the textbox seems to hang and stop updating the text. If you touch the text box again or enter a few more characters, it will send a few more letters, etc. until it eventually catches up to what was typed. I am able to reproduce this with a simple text box bound to a viewmodel property. The problem does not exist in older builds of Windows, nor when typing with a physical keyboard. I suspect it is from the 1803 update. I can take a video to demonstrate if necessary.

//Xaml

<Page
    x:Class="TextBoxDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TextBoxDemo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <TextBox
            Text="{x:Bind FooProperty, Mode=TwoWay}"/>
    </Grid>
</Page>

//Xaml.cs using Windows.UI.Xaml.Controls;

namespace TextBoxDemo
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        public string FooProperty { get; set; }
    }
}

I also tried:

  • Text="{Binding FooTextProperty, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">

  • using a one way bind and handling the TextChanged event to update the property

This is a pretty big problem for us and extremely easy to reproduce so I hope I am just doing something wrong.

Update: I should mention it is much easier to reproduce while remote debugging, though the issue has been reported in release builds as well. Here is a video demo. I type "This is a test". By the time I start typing "is", it is already lagging behind, and then it gets stuck at "This is" until I touch the text box again. https://drive.google.com/file/d/13s_fcSGJtL2l1bPgcMrcLgqpLFBMfKvb/view?usp=sharing

J Nelson
  • 138
  • 1
  • 1
  • 12
  • You should implement the INotifyPropertyChangedEvent for FooProperty… – thezapper Aug 14 '18 at 06:12
  • This is interesting and should not cause hangs, could you post a video? Does it stop happening when you remove the binding? – Martin Zikmund Aug 14 '18 at 06:24
  • I have tested in my device, but it could not be reproduced, and if you have video recording please post in your case. – Nico Zhu Aug 14 '18 at 07:53
  • @MartinZikmund and Nico I just added a link to a video above. – J Nelson Aug 15 '18 at 11:12
  • @thezapper Thanks for the reminder -- I did not mention that in the real app I'm using Fody to automatically generate the property change events for me. However it is not relevant to the issue I'm seeing because the property change is broken from the keyboard to the textbox, not from the backing property to the text box. – J Nelson Aug 15 '18 at 11:12
  • Just to confirm - is this happening without any binding as well? And also - does it happen on multiple devices? – Martin Zikmund Aug 15 '18 at 11:24
  • @MartinZikmund that's correct, I can reproduce it with just with no bindings. It has been reported on at least 3 separate devices, of which 2 have the same specs. – J Nelson Aug 15 '18 at 16:24
  • That is extremely weird. it does seem like a OS issue. Just out of curiosity, can you reproduce it one some other app from the Windows Store? – Martin Zikmund Aug 15 '18 at 16:36

0 Answers0