RFR: 8165214: ListView.EditEvent.getIndex() does not return the correct index
    Jeanette Winzenburg 
    fastegal at openjdk.java.net
       
    Mon Jun 21 12:32:49 UTC 2021
    
    
  
Issue was that the cancel event carried the listView's editingIndex at the time of firing the event - that's wrong nearly always (because the list's editing state/index might have changed between start and cancel, f.i. due to calling list.edit(someDifferentIndex)). 
Fixed by keeping the index at startEdit and using that in cancelEdit (similar approach as in TreeCell fix [TreeCell fix JDK-8265210](https://bugs.openjdk.java.net/browse/JDK-8265210). 
Added tests that are failing (and one that was accidentally passing) before, all passing after.
-------------
Commit messages:
 - 8165214: ListView.EditEvent.getIndex() does not return the correct index
Changes: https://git.openjdk.java.net/jfx/pull/539/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=539&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8165214
  Stats: 105 lines in 2 files changed: 98 ins; 4 del; 3 mod
  Patch: https://git.openjdk.java.net/jfx/pull/539.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/539/head:pull/539
PR: https://git.openjdk.java.net/jfx/pull/539
    
    
More information about the openjfx-dev
mailing list