Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: 9.6.0.1
-
Fix Version/s: 9.6.1
-
Component/s: None
-
Security Level: Jimmy
-
Labels:None
Description
Steps to Reproduce
https://zkfiddle.org/sample/2pvqgk0/18-Another-new-ZK-fiddle
Run fiddle
Select last Listitem
Click button (delete last item)
Shift+Click any Listitem
Current Result
Error: Index: 6, Size: 6
Expected Result
no error
Debug Information
caused by the Listbox._selectUpto function (from SelectWidget)
this._lastSelectedItem is not deleted from Listbox when listitem is removed, Listbox tries to use a non-existing index
Workaround
(see fiddle, commented out)
Secondary issue, related to main issue
If there is no selected element (due to component just having been rendered, and no selection triggered), doing shift+click on an item will select all items from index 0 to target (see 2nd listbox with selected items content filled onSelect)
However, only the targeted Listitem is marked as selected.
(This is due to the same line of code as the main issue, if no bounding item is found)