From 54fdb7ab466c5185590c9151608570c75ba176a4 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 7 Jan 2021 12:48:51 +0800 Subject: [PATCH] fix: set to null when password field is empty --- .../app/src/components/form.fields/password/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/form.fields/password/index.tsx b/packages/app/src/components/form.fields/password/index.tsx index 2075d779e..d7c896cd8 100644 --- a/packages/app/src/components/form.fields/password/index.tsx +++ b/packages/app/src/components/form.fields/password/index.tsx @@ -13,11 +13,18 @@ export interface IPasswordProps extends PasswordProps { export const Password = connect({ getProps: mapStyledProps })(styled((props: IPasswordProps) => { - const { value, className, checkStrength, ...others } = props + const { value, className, checkStrength, onChange, ...others } = props return ( - + { + // 密码字段,如果没有设置不处理 + onChange(e.target.value ? e : undefined); + }} + /> {checkStrength && ( {score => {