Browse Source

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 year ago
parent
commit
1505606ad7
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      src/index.ts

+ 1
- 3
src/index.ts View File

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


Loading…
Cancel
Save