Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vaadin-Grid: Problem with Select field in header if column is sortable #4170

Closed
hoshie82 opened this issue Nov 22, 2022 · 0 comments · Fixed by vaadin/web-components#5089
Closed
Assignees
Labels

Comments

@hoshie82
Copy link

Description

Problem is, that the sorting is triggered, if I try to select something in the Select-field... Problem seems to be always caused, if the used component has no own focus like a textfield or a combobox..
The select field is part of a filter in the table, so it is necessary...

vaadin/vaadin-grid#1378 describes the same problem, but combobox uses a text field, that can be focused.

Expected outcome

Selecting something in the field must not trigger sorting.

Minimal reproducible example

        Grid<String> grid = new Grid<>();

        Column<String> column = grid.addColumn(s -> s).setSortable(true);

        List<String> items = Arrays.asList("A", "B", "C", "D", "E");
        grid.setItems(items);

        Select<String> select = new Select<>();
        select.setItems(items);
        select.setEmptySelectionAllowed(false);

        grid.appendHeaderRow().getCell(column).setComponent(select);
        parent.add(grid);

Steps to reproduce

Select something from the field. The column is sorted in the background...

Environment

  • Vaadin / Flow version: 23.2.2
  • Java version: 12
  • OS version: Windows 10

Browsers

Chrome, Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants