vaadin / vaadin/framework

Grid Editor does not save changes when pressing enter after it was opened programatically.

Open
#11,105 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale workaround
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

I am using Grid Editor and am opening the editor not via the standard double click, but via an external button (or context menu plugin it does not matter), by calling

grid.getEditor().editRow(rowIndex);

When I change the content in some column (I am using TextField) and then press enter I would expect my changes to be saved. However, the changes are restored to their original value if I edit and hit enter relatively quickly. When I wait a short moment before pressing Enter or if I open the editor via double-click the editor behaves as expected.

To reproduce this it is best to focus the text field programmatically when the editor opens, so you can type the new value and hit enter without moving the mouse. I have slightly modified one of the existing test cases here: https://github.com/teltopr/framework/commit/70b3d060a71b2019811a0e50217ca7a628ab7525

When you run this UI you can click 'Add' to add a new row, then 'Edit' which will open the editor and put the focus on the textfield in the 'Value' column. Quickly type something and hit enter and your changes will be dismissed instead of saved.

  • Vaadin Framework version (e.g. 8.5.1 and recent master)
  • Chrome 68

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing Grid Editor test case and the programmatic grid.getEditor().editRow(rowIndex) path described in the issue. Reproduce the failure by focusing the TextField, changing its value, and pressing Enter quickly; done means the edited value is saved rather than restored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.