From cc7320f1a949dd189925399ad3be8ca2e619b4cf Mon Sep 17 00:00:00 2001
From: Steve Sanderson
+ The point of this test is to show that even in this hostile environment, we don't break the ability + to type normally, nor do we lose any of your typed characters. +
+ + + +@code { + string _inputText; + + string InputText + { + get => _inputText; + set + { + Thread.Sleep(100); + _inputText = value; + } + } +} diff --git a/src/Components/test/testassets/BasicTestApp/MovingCheckboxesComponent.razor b/src/Components/test/testassets/BasicTestApp/MovingCheckboxesComponent.razor new file mode 100644 index 000000000000..beca5e04d349 --- /dev/null +++ b/src/Components/test/testassets/BasicTestApp/MovingCheckboxesComponent.razor @@ -0,0 +1,56 @@ ++ This component represents a case that's difficult for the diff algorithm if it doesn't + understand how the underlying DOM gets mutated when you check a box. +
++ If we didn't have the RenderTreeUpdater, then if you checked the first incomplete item, + the diff algoritm would see the subsequent render has only one "todo" item left, and would + match it with the existing 'li' element. Since that's still not done, the algorithm would + think no change was needed to the checkbox. But since you just clicked that checkbox, the + UI would show it as checked. It would look as if you have completed all four items instead + of just three. +
++ RenderTreeUpdater fixes this by patching the old render tree to match the latest state of + the DOM, so the diff algoritm sees it must explicitly uncheck the remaining 'todo' box. +
+ +