fix: If the input type "Name" is selected, the label can't be changed from our default label "Your Name" (#10618)
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>1182-refactor-app-list-my-settings-conferencing-and-installed-app-conferencing^2
parent
a4e7ca91b5
commit
5301af2e9f
|
@ -530,6 +530,7 @@ function FieldLabel({ field }: { field: RhfFormField }) {
|
|||
const fieldTypeConfigVariantsConfig = fieldTypeConfig?.variantsConfig;
|
||||
const fieldTypeConfigVariants = fieldTypeConfigVariantsConfig?.variants;
|
||||
const variantsConfig = field.variantsConfig;
|
||||
const variantsConfigVariants = variantsConfig?.variants;
|
||||
const defaultVariant = fieldTypeConfigVariantsConfig?.defaultVariant;
|
||||
if (!fieldTypeConfigVariants || !variantsConfig) {
|
||||
if (fieldsThatSupportLabelAsSafeHtml.includes(field.type)) {
|
||||
|
@ -551,7 +552,9 @@ function FieldLabel({ field }: { field: RhfFormField }) {
|
|||
"Field has `variantsConfig` but no `defaultVariant`" + JSON.stringify(fieldTypeConfigVariantsConfig)
|
||||
);
|
||||
}
|
||||
return <span>{t(fieldTypeConfigVariants[variant as keyof typeof fieldTypeConfigVariants].label)}</span>;
|
||||
const label =
|
||||
variantsConfigVariants?.[variant as keyof typeof fieldTypeConfigVariants]?.fields?.[0]?.label || "";
|
||||
return <span>{t(label)}</span>;
|
||||
}
|
||||
|
||||
function VariantSelector() {
|
||||
|
|
Loading…
Reference in New Issue