Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

ItemsControl / ListBox Issues Roll-up

Open robloo opened this issue 7 months ago • 9 comments

Describe the bug

This is a Roll-up of Issues

Over the months the new ListBox and ItemsControl with many virtualization improvements has been put to the test. There are still some open issues with this group of controls after the rewrite that I want to summarize here. These issues are severe enough in some cases to prevent usage in production apps and also did not exist in the 0.10 version which performed almost flawlessly in general use (without virtualization).

  • [x] Virtualization is broken and items are not positioning correctly. It is believed some of these issues visible in the ItemsControl come from the VirtualizingStackPanel itself.
    • ~#12432 removed as it relates more to render transform usage~
    • https://github.com/AvaloniaUI/Avalonia/issues/12744
    • https://github.com/AvaloniaUI/Avalonia/issues/13607#issuecomment-1823301673
    • Closed in PR #13765 👍
  • [x] n-th child selector does not update correctly when changing bound collections or switching items source or even scrolling in the worse-case
    • https://github.com/AvaloniaUI/Avalonia/issues/12381
    • Closed in PR #13770
  • ~ObservableCollection changes are not picked up and processed correctly. It seems to corrupt the state in some cases if the bound collection is cleared/reset OR items are added/remove.~
    • Unable to repro this in a simple test case. It also may be more related to switching ItemsSource or virtualization problems which are both listed separately.
    • May be related to #11666 as well which has a fix
  • [ ] Changes in an item view model that raise property changed events will not always update the UI (within an ObservableCollection bound to a ListBox for example)
    • If a child item type implements INotifyPropertyChanged and is within an ObservableCollection, any changes to the child are NOT applied to the ItemsControl. This is a problem if the app is recycling it's own content and re-using existing item instances within an existing ObservableCollection and just applying new property values.
  • [ ] Switching ItemsSource does not always reset state without setting to null first
    • https://github.com/AvaloniaUI/Avalonia/issues/11846
  • [ ] Selection / Focus has some broken/missing edge cases
    • https://github.com/AvaloniaUI/Avalonia/issues/11666
    • https://github.com/AvaloniaUI/Avalonia/issues/11878
    • https://github.com/AvaloniaUI/Avalonia/issues/12733
    • https://github.com/AvaloniaUI/Avalonia/issues/13676

Other

  • https://github.com/AvaloniaUI/Avalonia/issues/11531
  • https://github.com/AvaloniaUI/Avalonia/issues/12185

Expected behavior

Everything should work as well as WPF and 0.10.

Additional context

This is a rough issue for now. There are many different issues and this is a first attempt to start bringing them all together and make sense of it. Expect this issue to change quite a bit as things are narrowed down and better understood. As I find better bug reports those will be linked in as well.

See individual issues and discussions for more details.

robloo avatar Nov 25 '23 16:11 robloo