ThreeGrid scrollToIndex(index) | Strange Scroll behaviour with expanded rows

Hello everyone,

on my current project i found a strange behaviour with the ThreeGrid component and his method “scrollToIndex(index)”. The issue is as follow:

I have a ThreeGrid, with several rows that are expanded and some not. If i call “refreshAll()” from the Dataprovider it jumps to index 0 (the standard behaviour). To prevent that i saved the index beforhand and are callen the following “UI.getCurrent().beforeClientResponse(threeGrid, ctx → threeGrid.scrollToIndex(previousIndex));” to scroll to the previous index. But instead of scrolling to that Index it scrolls severelle positions below it.

If the ThreeGrid contains no expanded rows it behavious like intended.

Do you guys have a idea for a quick workaround?

I will propably create a github issue or a support ticket later on if can allocate enough time to create example project that reproduces the issues.

With friendly regards

Sebastian

See https://vaadin.com/api/platform/current/com/vaadin/flow/component/treegrid/TreeGrid.html#scrollToIndex(int)

Oh, i didnt see that with one parameter it only scrolls on the root-level. Thank you for that hint.

Is there a recommended way to extract all indexes of ThreeGrid for all levels?

With friendly regards

Sebastian