fix(grid): preserve null text during editing

This commit is contained in:
zhangsan authored and GitHub committed 2026-07-20 01:00:01 +08:00
1 parent 834ad772c6
commit f8baedc6e6
3 files changed
+37 -1

No files matched your search

@@ -34,6 +34,26 @@ describe("dataGridCellDisplayText", () => {
});
describe("coerceDataGridCellValue", () => {
it.each(["null", "NULL", "Null", "nUlL"])("preserves literal %s input as text", (value) => {
expect(
coerceDataGridCellValue({
value,
oldValue: null,
databaseType: "mysql",
columnInfo: { data_type: "varchar(255)" },
}),
).toBe(value);
expect(
coerceDataGridCellValue({
value,
oldValue: "previous",
databaseType: "postgres",
columnInfo: { data_type: "text" },
}),
).toBe(value);
});
it("preserves an explicitly generated empty string for a null cell", () => {
const options = {
value: "",