mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: add a character counter for fields with length limits (#11558)
- refactors`getFormHelpers` to accept an options object - adds a `maxLength` option which will display a message and character counter for fields with length limits - set `maxLength` option for template description fields
This commit is contained in:
committed by
GitHub
parent
f9f94b5d01
commit
05eac64be4
@ -132,10 +132,9 @@ export const CreateUserForm: FC<
|
||||
label={Language.emailLabel}
|
||||
/>
|
||||
<TextField
|
||||
{...getFieldHelpers(
|
||||
"login_type",
|
||||
"Authentication method for this user",
|
||||
)}
|
||||
{...getFieldHelpers("login_type", {
|
||||
helperText: "Authentication method for this user",
|
||||
})}
|
||||
select
|
||||
id="login_type"
|
||||
data-testid="login-type-input"
|
||||
@ -180,12 +179,11 @@ export const CreateUserForm: FC<
|
||||
})}
|
||||
</TextField>
|
||||
<TextField
|
||||
{...getFieldHelpers(
|
||||
"password",
|
||||
form.values.login_type === "password"
|
||||
? ""
|
||||
: "No password required for this login type",
|
||||
)}
|
||||
{...getFieldHelpers("password", {
|
||||
helperText:
|
||||
form.values.login_type !== "password" &&
|
||||
"No password required for this login type",
|
||||
})}
|
||||
autoComplete="current-password"
|
||||
fullWidth
|
||||
id="password"
|
||||
|
Reference in New Issue
Block a user