Skip to content

Commit

Permalink
chore(): modify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanleehao committed Sep 12, 2023
1 parent 323f89a commit 5754291
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/design/src/input/InputPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface PasswordProps extends AntdPasswordProps {
publicKey?: string;
// 自定义加密算法 需要将加密后结果 return
customEncryption?: (value?: string) => string;
onChange?: (value?: string) => void;
onChange?: (value?: any) => void;
rules?: boolean | Validator[];
onValidate?: (passed: boolean) => void;
generatePasswordRegex?: RegExp;
Expand Down Expand Up @@ -63,7 +63,7 @@ const Password: React.FC<PasswordProps> = ({
const [fieldError, setFieldError] = useState<string[]>([]);
const [isValidating, setIsValidating] = useState(false);
const [isTouched, setIsTouched] = useState(false);
const [privateValue, setPrivateValue] = useState();
const [privateValue, setPrivateValue] = useState<string | undefined>();

const defaultRules: Validator[] = [
{
Expand All @@ -82,7 +82,7 @@ const Password: React.FC<PasswordProps> = ({
message: passwordLocale.strengthRuleMessage,
},
];
const newRules = rules && rules?.length > 0 ? rules : (rules ? defaultRules : []);
const newRules = rules && (Array.isArray(rules) && rules?.length > 0) ? rules : (rules ? defaultRules : []);

const handleChange = (newValue?: string) => {
if (!isTouched) {
Expand Down

0 comments on commit 5754291

Please sign in to comment.