ListViews
should not recycle the first view or the currently focused view
#14080
Labels
area/listview 📃
Categorizes an issue or PR as relevant to the ListView control
difficulty/medium 🤔
Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI
kind/bug
Something isn't working
project/items 🧾
Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)
Current behavior
Currently, any view that's not visible and is not within
CacheLength
will be recycled.Expected behavior
On WinUI, the first view is just never recycled. I'm not sure if there are specific scenarios where it is, but from my testing it seems like it just never gets recycled. Also, if a view is currently focused (either through mouse or keyboard), the view is never recycled even if scrolled out of view. This makes sense because we wouldn't want to lose focus just because of scrolling i.e. if we focus something, scroll away and back, the focus shouldn't change. The moment the focused out-of-visible-area view loses focus, it gets recycled.
How to reproduce it (as minimally and precisely as possible)
Most listview samples will do, e.g.
ListView_Aligned_Left
.Workaround
No response
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
No response
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: