only show the placeholder when the field isn't readonly (#32975)
fixes: #32657 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
e999b8fd82
commit
1ca56e6dd9
1 changed files with 12 additions and 6 deletions
|
@ -17,12 +17,18 @@ export const TextComponent = (props: UserProfileFieldProps) => {
|
||||||
id={attribute.name}
|
id={attribute.name}
|
||||||
data-testid={attribute.name}
|
data-testid={attribute.name}
|
||||||
type={type}
|
type={type}
|
||||||
placeholder={label(
|
placeholder={
|
||||||
props.t,
|
attribute.readOnly
|
||||||
attribute.annotations?.["inputTypePlaceholder"] as string,
|
? ""
|
||||||
attribute.name,
|
: label(
|
||||||
attribute.annotations?.["inputOptionLabelsI18nPrefix"] as string,
|
props.t,
|
||||||
)}
|
attribute.annotations?.["inputTypePlaceholder"] as string,
|
||||||
|
attribute.name,
|
||||||
|
attribute.annotations?.[
|
||||||
|
"inputOptionLabelsI18nPrefix"
|
||||||
|
] as string,
|
||||||
|
)
|
||||||
|
}
|
||||||
readOnly={attribute.readOnly}
|
readOnly={attribute.readOnly}
|
||||||
isRequired={isRequired}
|
isRequired={isRequired}
|
||||||
{...form.register(fieldName(attribute.name))}
|
{...form.register(fieldName(attribute.name))}
|
||||||
|
|
Loading…
Reference in a new issue