From 958d033383efa34b68bc8285ad0ee9b4c9ff8d2d Mon Sep 17 00:00:00 2001 From: Tobias Alex-Petersen Date: Thu, 12 Apr 2018 18:14:56 +0200 Subject: [PATCH] Fix TextareaWidget to render id and label reference correctly --- src/__tests__/themes.bootstrap3.TextareaWidget.spec.js | 2 ++ src/themes/bootstrap3/TextareaWidget.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/__tests__/themes.bootstrap3.TextareaWidget.spec.js b/src/__tests__/themes.bootstrap3.TextareaWidget.spec.js index 12b9fde..dd1503d 100644 --- a/src/__tests__/themes.bootstrap3.TextareaWidget.spec.js +++ b/src/__tests__/themes.bootstrap3.TextareaWidget.spec.js @@ -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'); }); }); diff --git a/src/themes/bootstrap3/TextareaWidget.js b/src/themes/bootstrap3/TextareaWidget.js index cf807e0..765b352 100644 --- a/src/themes/bootstrap3/TextareaWidget.js +++ b/src/themes/bootstrap3/TextareaWidget.js @@ -10,13 +10,13 @@ const renderInput = field => { ]); return (
-