Skip to content

Commit

Permalink
Merge pull request #42 from tapetersen/master
Browse files Browse the repository at this point in the history
Fix TextareaWidget to render id and label reference correctly
  • Loading branch information
nacmartin authored Dec 6, 2018
2 parents 20e7131 + 958d033 commit aa44304
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/__tests__/themes.bootstrap3.TextareaWidget.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ describe("TextareaWidget", () => {
const wrapper = render(Component);

expect(wrapper.find("textarea").length).toEqual(1);
expect(wrapper.find("textarea").prop('id')).toEqual('field-field');
expect(wrapper.find("label").prop('for')).toEqual('field-field');
});
});
4 changes: 2 additions & 2 deletions src/themes/bootstrap3/TextareaWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const renderInput = field => {
]);
return (
<div className={className}>
<label className="control-label" htmlFor={"field-" + field.name}>
<label className="control-label" htmlFor={"field-" + field.input.name}>
{field.label}
</label>
<textarea
{...field.input}
className="form-control"
id={"field-" + field.fieldName}
id={"field-" + field.input.name}
required={field.required}
placeholder={field.placeholder}
/>
Expand Down

0 comments on commit aa44304

Please sign in to comment.