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

Tabbing GridPro cells with custom editor emits item property changes #6816

Open
tomivirkki opened this issue Nov 13, 2024 · 0 comments
Open
Labels
bug Something isn't working Impact: Low Severity: Major UX User experience issue vaadin-grid-pro

Comments

@tomivirkki
Copy link
Member

Description

When using a custom editor in GridPro, tabbing through the column cells briefly displays wrong values in the blurred cells on slow network connection. This also produces unnecessary ItemPropertyChangedEvents with unchanged values.

Kapture.2024-11-13.at.10.53.07.mp4

Expected outcome

  • The blurred cells should not display invalid values
  • No ItemPropertyChangedEvent should be fired when there are no edits

Minimal reproducible example

@Route(value = "grid-pro-custom-editor")
public class GridProCustomEditorPage extends Div {
    public GridProCustomEditorPage() {
        List<SamplePerson> persons = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            persons.add(new SamplePerson("Person " + i));
        }

        GridPro<SamplePerson> grid = new GridPro<>();
        grid.setEditOnClick(true);
        grid.setItems(persons);

        TextField component = new TextField();
        grid.addEditColumn(SamplePerson::getName)
                .custom(component, SamplePerson::setName)
                .setHeader("Name");

        grid.addItemPropertyChangedListener(e -> {
            add(new Div("Item property changed. name: " + e.getItem().getName()));
        });

        add(grid);
    }
    
    public static class SamplePerson {
        private String name;

        public SamplePerson(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }
}

Steps to reproduce

  • Open the app
  • Enable network throttling to simulate slow connection
  • Click a cell to open the custom editor
  • Use keyboard tab to quickly loop over the column cells

Environment

Vaadin version(s): All versions with GridPro

Browsers

Issue is not browser related

@tomivirkki tomivirkki added bug Something isn't working vaadin-grid-pro labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Impact: Low Severity: Major UX User experience issue vaadin-grid-pro
Projects
None yet
Development

No branches or pull requests

2 participants