瀏覽代碼

Choose null instead of empty string for value

The value attribute of fields expect a string. We use a sentinel value
to clear the field.
master
TheoryOfNekomata 1 年之前
父節點
當前提交
1505606ad7
共有 1 個檔案被更改,包括 1 行新增3 行删除
  1. +1
    -3
      src/index.ts

+ 1
- 3
src/index.ts 查看文件

@@ -1311,9 +1311,7 @@ export const clearFormValues = (
);
const elementsWithSameName = getElementsOfSameName(filteredFieldElements);
const objectValues = Object.fromEntries(
Object.entries(elementsWithSameName).map(([key]) => [
key, '',
]),
Object.entries(elementsWithSameName).map(([key]) => [key, null]),
);
doSetFormValues(filteredFieldElements, elementsWithSameName, objectValues);
};


Loading…
取消
儲存