Repository navigation
Commit 30e8cc0
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
>
Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
1 parent 17cfd69 commit 30e8cc0
2 files changed
Lines changed: 18 additions & 2 deletions
File tree
- vaadin-grid-pro-flow-parent/vaadin-grid-pro-flow/src/main
- java/com/vaadin/flow/component/gridpro
- resources/META-INF/resources/frontend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
64 | 80 | | |
65 | 81 | | |
66 | 82 | | |
| |||
0 commit comments