diff --git a/webapp/packages/core-blocks/src/FormControls/InputField/InputFieldState.tsx b/webapp/packages/core-blocks/src/FormControls/InputField/InputFieldState.tsx index 3fdb281932..401968cd95 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputField/InputFieldState.tsx +++ b/webapp/packages/core-blocks/src/FormControls/InputField/InputFieldState.tsx @@ -29,14 +29,8 @@ export const InputFieldState: InputFieldType = observer - ); + const defaultValue = rest.type === 'password' ? null : controlState.defaultStringValue; + + return ; }), ) as InputFieldType; diff --git a/webapp/packages/core-blocks/src/FormControls/useFormStateControl.ts b/webapp/packages/core-blocks/src/FormControls/useFormStateControl.ts index 7d7febcf41..436875f942 100644 --- a/webapp/packages/core-blocks/src/FormControls/useFormStateControl.ts +++ b/webapp/packages/core-blocks/src/FormControls/useFormStateControl.ts @@ -47,14 +47,14 @@ export function useFormStateControl, TKey ext value = value[name]; } - let stringValue: string | typeof value; - let defaultStringValue: string | typeof defaultValue; + let stringValue: string | typeof value | null; + let defaultStringValue: string | typeof defaultValue | null; if (mapToString) { stringValue = mapToString(value as any); defaultStringValue = mapToString(defaultValue as any); } else { - stringValue = isNotNullDefined(value) ? String(value) : ''; - defaultStringValue = isNotNullDefined(defaultValue) ? String(defaultValue) : ''; + stringValue = isNotNullDefined(value) ? String(value) : null; + defaultStringValue = isNotNullDefined(defaultValue) ? String(defaultValue) : null; } const hide = 'autoHide' in rest && !!rest.autoHide && presented === false;