vaadin / framework8-issues

Legacy repository for issuse tracking realted to Framework 8. All new issues should be created at https://github.com/vaadin/framework/issues/new
2 stars 0 forks source link

Selects items in grid when calling Grid.scrollTo() #609

Closed rogozinds closed 6 years ago

rogozinds commented 7 years ago

Description When item in the grid is selected and you call scrollTo() to the item above it, grid selects all items in range between your selected item and the item you scroll to.

Browsers Chrome, Firefox

Example: @Override protected void init(VaadinRequest vaadinRequest) { Grid grid = new Grid(); grid.addColumn(String::toString); ArrayList items = new ArrayList<>();

    ListDataProvider<String> provider =  new ListDataProvider<>(items);
    for(int i=0;i<100;i++) {
        items.add(""+i);
    }
    grid.setDataProvider(provider);
    Button button = new Button("Add");
    button.addClickListener(e->{
        items.add("BAR");
        provider.refreshAll();
        grid.scrollTo(100);
    });

    final VerticalLayout layout = new VerticalLayout();
    layout.addComponents(grid);
    layout.addComponents(button);

    setContent(layout);
}

Way to reproduce: Run example. Click about 10 times on the button, to add 10 items in the grid. Select the last item in the grid. Click add button Again.

Expected behaviour: Just scroll without any selection.

stale[bot] commented 6 years ago

The issues in this repository are considered obsolete. If this issue is still relevant, please comment that it should be moved to the correct repository. This can also be done by opening a new ticket in vaadin/framework.