Skip to content

Commit 89a4d12

Browse files
ssamulinatanrolnik
authored andcommitted
Feature: When editing Object or Array fields the data is displayed in a prettier format and the textarea is resizable (#734)
1 parent a145788 commit 89a4d12

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### NEXT RELEASE
44

55
* _Contributing to this repo? Add info about your change here to be included in next release_
6+
* Feature: When editing Object or Array fields the data is displayed in a prettier format and the textarea is resizable
67
* Fix: Display bug on safari when table has empty cells ('')
78

89
### 1.0.28

src/components/StringEditor/StringEditor.react.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ export default class StringEditor extends React.Component {
5050
render() {
5151
let onChange = this.props.readonly ? () => {} : (e) => this.setState({ value: e.target.value });
5252
if (this.props.multiline) {
53+
var style = { minWidth: this.props.minWidth };
54+
if (this.props.resizable) {
55+
style.resize = 'both';
56+
}
5357
return (
5458
<div className={styles.editor}>
5559
<textarea
5660
ref='input'
5761
value={this.state.value}
5862
onChange={onChange}
59-
style={{ minWidth: this.props.minWidth }} />
63+
style={style} />
6064
</div>
6165
);
6266
}

src/dashboard/Data/Browser/Editor.react.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ let Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit }
3737
}
3838
content = (
3939
<StringEditor
40-
value={JSON.stringify(value)}
40+
value={JSON.stringify(value, null, 2)}
41+
resizable={true}
4142
multiline={true}
4243
width={width}
4344
onCommit={encodeCommit} />

0 commit comments

Comments
 (0)