Skip to content

fix(datagrid): save NULL when a date or number cell is cleared - #3428

Merged
datlechin merged 2 commits into
mainfrom
fix/date-clear-saves-null
Oct 15, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/date-clear-saves-null

Conversation

@datlechin

@datlechin datlechin commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Why

Clearing a date cell and saving wrote an empty string, which MySQL without strict mode stores as 0000-00-00 00:00:00, so a cleared deleted_at still read as deleted. Every editing surface turned typed text into a value without looking at the column type, and copy and paste turned a NULL into the text NULL.

Change

  • An emptied date, number, boolean, JSON, geometry or array cell stages NULL in the grid, inspector, Fill Column and paste. Text, SET and binary keep ''. A NOT NULL column of those types refuses the edit, since NULL there becomes the current time on MySQL with explicit_defaults_for_timestamp off.
  • Set Value > Empty and Set EMPTY appear only where '' is a value.
  • Cell copy carries its fields beside the text, so a pasted NULL stays NULL and a value with a tab or line break stays one value. An empty line no longer shifts the rows below it.
  • The inspector shows a NULL set in the grid as NULL, not false. Elasticsearch long, short and date_nanos fields classify as numbers and dates.

Verified

ClearedCellCommitTests and MultiRowEditStateClearedFieldTests fail on main and pass here. Changed on purpose: MultiRowEditStateTests pinned a grid-set NULL as an empty pending value; FillColumnTests follows fillColumnValue(text:setNull:columnIndex:). The Elasticsearch plugin compiles; it has no test target and reaches users with its next plugin release.

Not in this PR

Docs: TableProApp/docs#22

An emptied cell was staged as an empty string whatever the column type,
so MySQL without strict mode stored a cleared DATETIME as the zero date.
Typed text is now read for its column: a type with no empty value stages
NULL, and a NOT NULL column of such a type refuses the edit.
A copied NULL and a stored 'NULL' copied as the same text, and a value
with a tab or line break split into extra fields on paste. The grid's
cell copy now carries its fields beside the text, and both cell and row
paste read them while the clipboard still holds that copy.

The inspector marks a NULL staged in the grid as a pending NULL instead
of an empty string, so its boolean picker no longer reads false.

Elasticsearch browse results hint long, short, byte, the float variants
and date_nanos to the classifier, so clearing one writes NULL.
@datlechin
datlechin merged commit e127f84 into main Oct 15, 2026
7 of 8 checks passed
@datlechin
datlechin deleted the fix/date-clear-saves-null branch October 15, 2026 11:18
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.

1 participant