Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### NEXT RELEASE

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

### 1.0.28
Expand Down
6 changes: 5 additions & 1 deletion src/components/StringEditor/StringEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ export default class StringEditor extends React.Component {
render() {
let onChange = this.props.readonly ? () => {} : (e) => this.setState({ value: e.target.value });
if (this.props.multiline) {
var style = { minWidth: this.props.minWidth };
if (this.props.resizable) {
style.resize = 'both';
}
return (
<div className={styles.editor}>
<textarea
ref='input'
value={this.state.value}
onChange={onChange}
style={{ minWidth: this.props.minWidth }} />
style={style} />
</div>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard/Data/Browser/Editor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ let Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit }
}
content = (
<StringEditor
value={JSON.stringify(value)}
value={JSON.stringify(value, null, 2)}
resizable={true}
multiline={true}
width={width}
onCommit={encodeCommit} />
Expand Down