diff --git a/src/Ursa/Controls/TagInput/TagInput.cs b/src/Ursa/Controls/TagInput/TagInput.cs index 7b93b26..30773d4 100644 --- a/src/Ursa/Controls/TagInput/TagInput.cs +++ b/src/Ursa/Controls/TagInput/TagInput.cs @@ -166,11 +166,14 @@ public class TagInput : TemplatedControl var newTags = args.GetNewValue>(); var oldTags = args.GetOldValue>(); - // remove all tags except the textbox - int count = Items.Count; - for (int i = 0; i < count - 1; i++) + if (Items is AvaloniaList avaloniaList) { - Items.RemoveAt(0); + avaloniaList.RemoveRange(0, avaloniaList.Count - 1); + } + else if (Items.Count != 0) + { + Items.Clear(); + Items.Add(_textBox); } if (newTags != null)