Skip to content

fix: sync editor value to server when same value is typed again (#9568) (CP: 25.2)#9572

Merged
sissbruecker merged 1 commit into
25.2from
cherry-pick-9568-to-25.2-1782123180380
Jun 22, 2026
Merged

fix: sync editor value to server when same value is typed again (#9568) (CP: 25.2)#9572
sissbruecker merged 1 commit into
25.2from
cherry-pick-9568-to-25.2-1782123180380

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #9568 to branch 25.2.

Original PR description

Description

Since a recent change, Firefox treats input fields that have the same value on blur as they had on focus as unchanged, even if the value was changed programmatically in between. This is problematic for custom editors in GridPro, where the value is set programmatically from the server after the client-side component has already focused the editor. If, after starting editing, a user types exactly the same value that the input had before the server updated the editor value, no change event is fired and the editor value is never synced to the server where it would be used to update the item data:

  • First edit:
    • User edits cell, types "foo", commits
    • "foo" is different from the value the editor had before focus (empty value), property is synced to the server
    • item-property-change fires, server detects change in the editor's value, item is updated on server
  • Second edit (same column, different cell)
    • User starts editing, web component focuses editor component immediately
    • Initially the client-side value is still "foo", the server only updates the editor's value once it receives the cell-edit-started event, which eventually results in a client-side update of the editor value, let's say to "bar"
    • User types "foo" again, commits
    • "foo" is not different from the value the editor had before focusing it, no change event is fired for the editor, it's value is not synced back to the server
    • item-property-change fires, server does not detect a change in the editor's value, no item update

This change addresses the issue by always firing a synthetic change event whenever an input element loses focus. The fix is scoped only Firefox, and only to custom editors. For built-in editors no such fix is needed as the edited value is applied by the web component before focusing. The change is not covered by tests, as the issue only manifests in Firefox whereas tests only run in Chrome.

Fixes #9437

Type of change

  • Bugfix

## Description

Since a recent change, Firefox treats input fields that have the same
value on blur as they had on focus as unchanged, even if the value was
changed programmatically in between. This is problematic for custom
editors in GridPro, where the value is set programmatically from the
server after the client-side component has already focused the editor.
If, after starting editing, a user types exactly the same value that the
input had before the server updated the editor value, no change event is
fired and the editor value is never synced to the server where it would
be used to update the item data:
- First edit:
  - User edits cell, types "foo", commits
- "foo" is different from the value the editor had before focus (empty
value), property is synced to the server
- `item-property-change` fires, server detects change in the editor's
value, item is updated on server
- Second edit (same column, different cell)
- User starts editing, web component focuses editor component
immediately
- Initially the client-side value is still "foo", the server only
updates the editor's value once it receives the `cell-edit-started`
event, which eventually results in a client-side update of the editor
value, let's say to "bar"
  - User types "foo" again, commits
- "foo" is not different from the value the editor had before focusing
it, no change event is fired for the editor, it's value is not synced
back to the server
- `item-property-change` fires, server does not detect a change in the
editor's value, no item update

This change addresses the issue by always firing a synthetic change
event whenever an input element loses focus. The fix is scoped only
Firefox, and only to custom editors. For built-in editors no such fix is
needed as the edited value is applied by the web component before
focusing. The change is not covered by tests, as the issue only
manifests in Firefox whereas tests only run in Chrome.

Fixes #9437

## Type of change

- Bugfix
@sonarqubecloud

Copy link
Copy Markdown

@sissbruecker
sissbruecker merged commit 30e8cc0 into 25.2 Jun 22, 2026
16 checks passed
@sissbruecker
sissbruecker deleted the cherry-pick-9568-to-25.2-1782123180380 branch June 22, 2026 11:13
@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This ticket/PR has been released with Vaadin 25.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants