On Thu, 4 Jun 2020 11:23:42 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:

> 
> 
> > The other selectionModels for virtualized controls try to keep the 
> > selectedItem/Index only.
> 
> Keeping the selection after sort/permutation seems more correct from a user's 
> perspective. I did not look into how
> other controls handle this. Looking at your observation seems like we need to 
> fix this in other controls too,
> preferably each control in a separate issue :)

well, I don't think so (except for tree which is doing 
the-wrong-thingy-always): they do keep all state on sort, but
not on replace-in-different-sequence - which is correct, I think: it's the 
semantic of the change notification that
must rule, not some assumption of the view.

If a replace-in-different-sequence is required to be interpretated as a 
permutation in a particular use-case, the place
to implement it would be a custom list that checks for that corner case and 
sends a notification of type wasPermutated
(instead of a wasReplaced).

-------------

PR: https://git.openjdk.java.net/jfx/pull/244

Reply via email to