Skip to content

Commit 0546d34

Browse files
authored
Merge pull request RIP21#43 from jrsinclair/master
Adding optional label to address RIP21#41
2 parents 904cca6 + bab0c33 commit 0546d34

16 files changed

+42914
-37817
lines changed

demo/dist/js/bundle.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19829,6 +19829,7 @@
1982919829
'Click me to update the textValue outside of the editor'
1983019830
),
1983119831
React.createElement(Editor, {
19832+
label: 'Markdown Editor',
1983219833
value: this.state.textValue1,
1983319834
handleEditorChange: this.handleChange1
1983419835
}),
@@ -19939,7 +19940,8 @@
1993919940

1994019941
render: function () {
1994119942
const textarea = React.createElement('textarea', { id: this.id });
19942-
return React.createElement('div', { id: `${this.id}-wrapper`, className: this.props.className }, textarea);
19943+
const label = this.props.label ? React.createElement('label', { htmlFor: this.id }, [this.props.label]) : false;
19944+
return React.createElement('div', { id: `${this.id}-wrapper`, className: this.props.className }, [label, textarea]);
1994319945
}
1994419946
});
1994519947

@@ -37526,6 +37528,7 @@
3752637528
return React.createElement(SimpleMDEReact, {
3752737529
onChange: this.props.handleEditorChange,
3752837530
options: this.getMarkdownOptions(),
37531+
label: this.props.label,
3752937532
value: this.props.value,
3753037533
extraKeys: this.props.extraKeys
3753137534
});

demo/scripts/Editor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = React.createClass({
1717
<SimpleMDEReact
1818
onChange={this.props.handleEditorChange}
1919
options={this.getMarkdownOptions()}
20+
label={this.props.label}
2021
value={this.props.value}
2122
extraKeys={this.props.extraKeys}
2223
/>

demo/scripts/demo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module.exports = React.createClass({
5858
Click me to update the textValue outside of the editor
5959
</button>
6060
<Editor
61+
label="Markdown Editor"
6162
value={this.state.textValue1}
6263
handleEditorChange={this.handleChange1}
6364
/>

0 commit comments

Comments
 (0)