Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RemoveAtEnd on TreeViewNodeVector broken
Ported an app from UWP to WinUI3 and noticed a bunch of UI 'corruption' in our TreeView control when filtering elements. Tracked it down to TreeView.RootNodes().RemoveAtEnd() always removing the first item instead of the last item, which means you are left with a totally unexpected result, as well as being unable to remove all the items due to never being able to remove index 0. The bug is due to incorrect parameter passing (ideally unused stack variable warnings would be enabled and would catch this), where index was intialized, but never passed to RemoveAt, causing the `updateItemsSource` boolean to stand in for an index, causing us to always delete index 0 or 1 instead of N-1. The workaround is to just manually use RemoveAt instead of RemoveAtEnd.
- Loading branch information