diff --git a/gradle/changelog/password_field.yaml b/gradle/changelog/password_field.yaml new file mode 100644 index 0000000000..4d807d3e70 --- /dev/null +++ b/gradle/changelog/password_field.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Password field in "Create User" dialog and other ((#1934)[https://github.com/scm-manager/scm-manager/pull/1934]) diff --git a/scm-ui/ui-components/src/forms/PasswordConfirmation.tsx b/scm-ui/ui-components/src/forms/PasswordConfirmation.tsx index ed699d9358..5aeeb8ea5d 100644 --- a/scm-ui/ui-components/src/forms/PasswordConfirmation.tsx +++ b/scm-ui/ui-components/src/forms/PasswordConfirmation.tsx @@ -58,7 +58,13 @@ const PasswordConfirmation: FC = ({ passwordChanged, passwordValidat setPasswordConfirmationFailed(password !== newConfirmedPassword); }; - const handlePasswordChange = (newPassword: string) => { + const handlePasswordChange = (event: React.ChangeEvent | string) => { + let newPassword; + if (typeof event === "string") { + newPassword = event; + } else { + newPassword = event.target.value; + } setPasswordConfirmationFailed(newPassword !== confirmedPassword); setPassword(newPassword); setPasswordValid(validatePassword(newPassword)); @@ -70,7 +76,7 @@ const PasswordConfirmation: FC = ({ passwordChanged, passwordValidat handlePasswordChange(event.target.value)} + onChange={event => handlePasswordChange(event)} value={password} validationError={!passwordValid} errorMessage={t("password.passwordInvalid")}