feat(data-grid): bulk-edit empty input sets selected cells to NULL

In the 'Bulk Edit Selection' dialog, submitting with an empty input now
sets every selected editable cell to SQL NULL instead of an empty string,
matching the field's 'Value, or NULL' placeholder. fillSelectionWithValue()
accepts string | null so null flows through to applyCellValue().

Co-authored-by: kkk000111999 <kkk000111999@users.noreply.github.com>
This commit is contained in:
kkk000111999andkkk000111999 authored and GitHub committed 2026-06-27 12:15:40 +08:00
1 parent 4d435e2aab
commit b226ab174b
1 file changed
+4 -2
@@ -4944,7 +4944,7 @@ function applyVisibleCellValue(item: RowItem, visibleCol: number, value: string
return true;
}
function fillSelectionWithValue(value: string): boolean {
function fillSelectionWithValue(value: string | null): boolean {
const range = selectedRange.value;
let applied = false;
if (range) {
@@ -5003,7 +5003,9 @@ function openBulkEditDialog() {
}
function applyBulkEditValue() {
if (!fillSelectionWithValue(bulkEditValue.value)) return;
// Empty input sets the selected cells to SQL NULL (the placeholder hints "Value, or NULL").
const value = bulkEditValue.value === "" ? null : bulkEditValue.value;
if (!fillSelectionWithValue(value)) return;
bulkEditDialogOpen.value = false;
}