fix(richtext-*): use correct "for" attribute for label (#10036)

Fixes https://github.com/payloadcms/payload/issues/10034
This commit is contained in:
Sasha
2024-12-19 01:58:59 +02:00
committed by GitHub
parent 97a1f4afa9
commit 97c120ab28
2 changed files with 2 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ const RichTextComponent: React.FC<
CustomComponent={Error}
Fallback={<FieldError path={path} showError={showError} />}
/>
{Label || <FieldLabel label={label} localized={localized} required={required} />}
{Label || <FieldLabel label={label} localized={localized} path={path} required={required} />}
<div className={`${baseClass}__wrap`}>
<ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>
{BeforeInput}

View File

@@ -313,7 +313,7 @@ const RichTextField: React.FC<LoadedSlateFieldProps> = (props) => {
return (
<div className={classes} style={styles}>
{Label || <FieldLabel label={label} required={required} />}
{Label || <FieldLabel label={label} path={path} required={required} />}
<div className={`${baseClass}__wrap`}>
<RenderCustomComponent
CustomComponent={Error}