Skip to content

Commit 5d806c8

Browse files
authored
Merge pull request #260 from lkiesow/label-for
Assign Labels to Form Fields
2 parents 245206b + e4faa87 commit 5d806c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/Metadata.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ const Metadata: React.FC<{}> = () => {
432432
* @param input
433433
*/
434434
const generateComponent = (field: MetadataField, input: any) => {
435+
input.id = input.name
435436
if (field.collection) {
436437
if (Array.isArray(field.value)) {
437438
return (
@@ -517,7 +518,7 @@ const Metadata: React.FC<{}> = () => {
517518
>
518519
{({ input, meta }) => (
519520
<div css={fieldStyle}>
520-
<label css={fieldLabelStyle}>{
521+
<label css={fieldLabelStyle} htmlFor={input.name}>{
521522
i18n.exists(`metadata.labels.${field.id}`) ?
522523
t(`metadata.labels.${field.id}`) : field.id
523524
}</label>

0 commit comments

Comments
 (0)