Skip to content

Fix inline editing second-edit stale value (#948) - #1297

Open
radimvaculik wants to merge 1 commit into
masterfrom
fix/948-editable-value-second-editing
Open

Fix inline editing second-edit stale value (#948)#1297
radimvaculik wants to merge 1 commit into
masterfrom
fix/948-editable-value-second-editing

Conversation

@radimvaculik

Copy link
Copy Markdown
Member

Problem

When a column uses setEditableValueCallback() together with inline editing, the first edit works correctly, but a second edit of the same cell shows the value from before the first edit.

Reported in #948.

Root cause

On render, the cell stores the raw editable value in the data-datagrid-editable-value attribute, while innerHTML holds the rendered representation. The client reads valueToEdit from that attribute.

After a successful edit, the client updates only innerHTML (to _datagrid_editable_new_value), but never updates the data-datagrid-editable-value attribute. So the next edit reads the stale value captured on the initial page load.

Fix

After a successful inline edit, sync data-datagrid-editable-value with the submitted input value, so subsequent edits start from the current value. Applies to both text/textarea and select inputs.

Purely client-side (assets/plugins/features/editable.ts); no server round-trip needed since the submitted raw value is already available on the client.

Closes #948

Po úspěšné inline editaci se aktualizuje atribut data-datagrid-editable-value zadanou hodnotou, aby druhá editace vycházela z aktuální hodnoty místo hodnoty z prvotního načtení stránky (issue #948).
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.12%. Comparing base (ab5506d) to head (ea4b484).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1297   +/-   ##
=======================================
  Coverage   49.12%   49.12%           
=======================================
  Files          63       63           
  Lines        2974     2974           
=======================================
  Hits         1461     1461           
  Misses       1513     1513           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setEditableValueCallback and second editing

1 participant