mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Ensure scrolled to top after loading deck in list view
This commit is contained in:
@@ -126,6 +126,7 @@ public abstract class ItemView<T extends InventoryItem> {
|
|||||||
protected void fixSelection(final Iterable<T> itemsToSelect, final int backupIndexToSelect, final int scrollValueToRestore) {
|
protected void fixSelection(final Iterable<T> itemsToSelect, final int backupIndexToSelect, final int scrollValueToRestore) {
|
||||||
if (itemsToSelect == null) {
|
if (itemsToSelect == null) {
|
||||||
setSelectedIndex(0, false); //select first item if no items to select
|
setSelectedIndex(0, false); //select first item if no items to select
|
||||||
|
setScrollValue(0); //ensure scrolled to top
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!setSelectedItems(itemsToSelect)) {
|
if (!setSelectedItems(itemsToSelect)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user