Skip to content

Scroll to item not working as expected Vadin 24.1.4 / Selection tree grid 3.0.1 #43

@finaris-cs

Description

@finaris-cs

I am pretty sure that this worked in the past, as I used this method in our app to scroll to an item after adding it to a large tree-structure.

    public void scrollToItem(T item) {
        expandAncestor(item);
        int index = getIndexForItem(item);
        if (index >= 0) {
            this.getElement().executeJs("this.scrollWhenReady($0, true);", index);
        }
    }

From debugging, I could observe the following:

  • The calculated index seems to be correct (= index counting items from top taking expansion state of items into account)
  • The js scrollWhenReady seems to interpret the index as "index of the root-item to scroll to". If index = 10 for example, it scrolls to the 10th root item (or last if there are less), and not to the 10th visual item taking expansion states into account

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions