vaadin-component-factory / selection-grid-flow

Add the functionality to Vaadin Grid to focus on a particular row and column and select a range of rows with SHIFT/CTRL Click
https://incubator.app.fi/selection-grid-flow-demo/
Apache License 2.0
4 stars 8 forks source link

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

Open finaris-cs opened 1 year ago

finaris-cs commented 1 year ago

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:

finaris-cs commented 1 year ago

as workaround, i just realized that there is a scrollToIndex(int...) Method, accepting the indexes for the particular levels. Using that method works for me

askpythia commented 1 year ago

scrollToIndex also does not work for us, stays on top of the list ... :-(