Ver código fonte

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 ano atrás
pai
commit
1505606ad7
1 arquivos alterados com 1 adições e 3 exclusões
  1. +1
    -3
      src/index.ts

+ 1
- 3
src/index.ts Ver arquivo

@@ -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);
};


Carregando…
Cancelar
Salvar