1) Render a listbox with checkmark and droppable enabled
2) Fix the height to visualize the vertical scrollbar
3) Scroll down to last items and select one by clicking on the checkbox
The listbox will scroll to top when it will be checked for the first time.
To replicate this bug, please use the following source:
<zk>
Drag project to other list or same list for reorder
<hbox>
<listbox id="left" height="150px" width="200px" onDrop="move(event.dragged)" droppable="true" checkmark="true" multiple="true"
oddRowSclass="non-odd">
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK Forge" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK Mobile" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK GWT" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK JSF" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK JSP" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK Spring" />
</listitem>
</listbox>
<separator />
<listbox id="right" height="150px" width="200px" checkmark="true"
oddRowSclass="non-odd" onDrop="move(event.dragged)" droppable="true"
multiple="true" >
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK" />
</listitem>
<listitem draggable="true" droppable="true" onDrop="move(event.dragged)">
<listcell src="/img/Centigrade-Widget-Icons/Briefcase-16x16.png" label="ZK Studio" />
</listitem>
</listbox>
</hbox>
<zscript>
void move(Component dragged) {
if (self instanceof Listitem) {
if (dragged.getParent().getId().equals("right")) {
self.parent.insertBefore(dragged, self.getNextSibling());
} else { self.parent.insertBefore(dragged, self.getNextSibling()); }
} else {
self.appendChild(dragged);
}
}
</zscript>
</zk>