Fix non editable username
This commit is contained in:
parent
533105d63a
commit
0cfe240590
@ -128,14 +128,21 @@ export function generateFtlFilesCodeFactory(
|
||||
' "value": function callee(target, source) {',
|
||||
' Object.keys(source).forEach(function (key) {',
|
||||
' var value = source[key];',
|
||||
' if (value instanceof Object) {',
|
||||
' if (!(target[key] instanceof Object)) {',
|
||||
' target[key] = {};',
|
||||
' }',
|
||||
' callee(target[key], value);',
|
||||
' } else {',
|
||||
' target[key] = value;',
|
||||
' if( target[key] === undefined ){',
|
||||
' target[key]= value;',
|
||||
' return;',
|
||||
' }',
|
||||
' if( value instanceof Object ){',
|
||||
' if( value instanceof Array ){',
|
||||
' value.forEach(function (entry){',
|
||||
' target[key].push(entry);',
|
||||
' });',
|
||||
' return;',
|
||||
' }',
|
||||
' callee(target[key], value);',
|
||||
' return;',
|
||||
' }',
|
||||
' target[key]= value;',
|
||||
' });',
|
||||
' return target;',
|
||||
' }',
|
||||
|
@ -44,6 +44,12 @@ export const Login = memo((props: LoginProps) => {
|
||||
(setIsLoginButtonDisabled(true), true)
|
||||
);
|
||||
|
||||
const [ usernameInputValue, setUsernameInputValue ] = useState(login.username ?? '');
|
||||
|
||||
const onUsernameChange = useConstCallback(
|
||||
(event: React.ChangeEvent<HTMLInputElement>)=>
|
||||
setUsernameInputValue(event.target.value)
|
||||
);
|
||||
|
||||
return (
|
||||
<Template
|
||||
@ -82,9 +88,10 @@ export const Login = memo((props: LoginProps) => {
|
||||
id="username"
|
||||
className={cx(kcProperties.kcInputClass)}
|
||||
name="username"
|
||||
value={login.username ?? ''}
|
||||
value={usernameInputValue}
|
||||
type="text"
|
||||
{...(usernameEditDisabled ? { "disabled": true } : { "autofocus": true, "autocomplete": "off" })}
|
||||
onChange={onUsernameChange}
|
||||
{...(usernameEditDisabled ? { "disabled": true } : { "autoFocus": true, "autocomplete": "off" })}
|
||||
/>
|
||||
</div>
|
||||
<div className={cx(kcProperties.kcFormGroupClass)}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user