Open vursen opened 8 months ago
Same problem with TreeGrid:
@Route("grid")
public class GridView extends Div {
private static class DataProvider
extends AbstractHierarchicalDataProvider<String, Void> {
@Override
public int getChildCount(HierarchicalQuery<String, Void> query) {
return 1000;
}
@Override
public Stream<String> fetchChildren(
HierarchicalQuery<String, Void> query) {
int limit = query.getLimit();
int offset = query.getOffset();
return IntStream.range(offset, offset + limit)
.mapToObj(index -> "Item " + index);
}
@Override
public boolean hasChildren(String item) {
return false;
}
@Override
public boolean isInMemory() {
return true;
}
}
public GridView() {
TreeGrid<String> treeGrid = new TreeGrid<>();
treeGrid.setDataProvider(new DataProvider());
treeGrid.addHierarchyColumn(ValueProvider.identity()).setHeader("Name");
Button scrollToEndAndStart = new Button("scroll to end and start", event -> {
treeGrid.scrollToEnd();
treeGrid.scrollToStart();
});
add(treeGrid, scrollToEndAndStart);
}
}
Description
scrollToEnd
gets always executed afterscrollToStart
regardless of their call order in the code.Expected outcome
When
scrollToStart
comes afterscrollToEnd
, I'd expect the grid to scroll to the end and then to the start.Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): 24.4 and earlier OS: Mac OS
Browsers
No response