Fix Bug 69733 - [LDAP] No option to validate entered data in Password field when configuring LDAP

This commit is contained in:
Alexey Safronov 2024-08-30 18:50:55 +04:00
parent 88b091f7ee
commit 0e460bf1f0

View File

@ -177,7 +177,7 @@ const PasswordInput = React.forwardRef(
[onKeyDown],
);
const changeInputType = () => {
const changeInputType = React.useCallback(() => {
const newType =
state.type === InputType.text ? InputType.password : InputType.text;
@ -185,7 +185,13 @@ const PasswordInput = React.forwardRef(
...s,
type: newType,
}));
};
}, [state.type]);
React.useEffect(() => {
if (isDisabled && state.type === InputType.text) {
changeInputType();
}
}, [isDisabled, changeInputType, state.type]);
const testStrength = useCallback(
(value: string) => {