From 4cf3dd0b79667dd81142ebac9e58216e18ff08b3 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 31 Oct 2023 14:00:49 +0100 Subject: [PATCH] Inserting items makes the StartU unstable. Fixes layout problems in a kinda complex scenario where items are inserted before doing a `BringIntoView`. Couldn't manage to write a test, but all other updates of `_firstIndex` make `_startUUnstable`: this was one missing that was an oversight. --- .../Primitives/RealizedStackElements.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Avalonia.Controls.TreeDataGrid/Primitives/RealizedStackElements.cs b/src/Avalonia.Controls.TreeDataGrid/Primitives/RealizedStackElements.cs index 47f24cc4..b03623cc 100644 --- a/src/Avalonia.Controls.TreeDataGrid/Primitives/RealizedStackElements.cs +++ b/src/Avalonia.Controls.TreeDataGrid/Primitives/RealizedStackElements.cs @@ -294,6 +294,7 @@ public void ItemsInserted(int index, int count, Action update { // The insertion point was before the first element, update the first index. _firstIndex += count; + _startUUnstable = true; } else {