-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
vaadin/web-components
#10192Labels
BFPImpact: LowSeverity: MinorUXUser experience issueUser experience issuebugSomething isn't workingSomething isn't workingvaadin-grid
Description
Description
When you have a Grid with one or more frozen columns at the end, and the Grid displays both a vertical and a horizontal scrollbar, applying e.g. a filter to reduce the number of items can cause the vertical scrollbar to disappear. This is currently not causing a recalculation of the frozen column position, but you can trigger the calculation e.g. by moving the horizontal scrollbar a little or resizing the browser window:

Expected outcome
Changing the item list should also recalculate the frozen-to-end column position if needed
Minimal reproducible example
public class HelloWorldView extends HorizontalLayout {
public HelloWorldView() {
setSizeFull();
VerticalLayout layout = new VerticalLayout();
Grid<String> grid = new Grid<>();
List<String> letters = new ArrayList<>();
for (char c = 'a'; c < 'z'; c++) {
letters.add(c + "");
}
GridListDataView<String> stringGridListDataView = grid.setItems(letters);
Button filterButton = new Button("Filter list");
filterButton.addClickListener( e-> stringGridListDataView.addFilter( s -> s.equals("a")) );
layout.add(filterButton);
grid.addColumn(s -> "Foo").setHeader("Id");
grid.addColumn(s -> "Bar").setHeader("First name");
grid.addColumn(s -> "Baz").setHeader("Last name");
grid.addColumn(s -> "Bizzle").setHeader("Birth date");
grid.addColumn(s -> "Quux").setHeader("Phone");
grid.addColumn(s -> "Zyzzyx").setHeader("Address");
grid.addColumn(p ->"Eius ducimus numquam provident est. Est dolorum odit soluta quia accusamus error fugiat. Alias beatae ut maiores eos.").setHeader("Lorem");
grid.addComponentColumn(p -> {
Button button = new Button(LumoIcon.PHONE.create());
button.addThemeVariants(ButtonVariant.LUMO_ICON);
return button;
}).setHeader("Call").setFrozenToEnd(true);
layout.add(grid);
add( layout);
}
}Steps to reproduce
- Resize your browser so that the Grid gains a horizontal scrollbar
- Click the "filter list" button
- Observe that the frozen column at the end is off by the width of the vertical scrollbar that is no longer there
- Move the horizontal scrollbar a bit
- Observe that the frozen column pops in the right place
Environment
Vaadin version(s): 24.4.4
OS: Windows 11
Browsers
Issue is not browser related
Metadata
Metadata
Assignees
Labels
BFPImpact: LowSeverity: MinorUXUser experience issueUser experience issuebugSomething isn't workingSomething isn't workingvaadin-grid