Merge pull request #1445 from matrix-org/luke/fix-editable-item-list
Fix a couple of bugs with EditableItemList
This commit is contained in:
@@ -104,7 +104,7 @@ module.exports = React.createClass({
|
|||||||
if (value.length === 0) {
|
if (value.length === 0) {
|
||||||
this.onItemRemoved(index);
|
this.onItemRemoved(index);
|
||||||
} else {
|
} else {
|
||||||
this.onItemEdited(value, index);
|
this.props.onItemEdited(value, index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentWillReceiveProps: function(nextProps) {
|
componentWillReceiveProps: function(nextProps) {
|
||||||
if (nextProps.initialValue !== this.props.initialValue) {
|
if (nextProps.initialValue !== this.props.initialValue ||
|
||||||
|
nextProps.initialValue !== this.value
|
||||||
|
) {
|
||||||
this.value = nextProps.initialValue;
|
this.value = nextProps.initialValue;
|
||||||
if (this.refs.editable_div) {
|
if (this.refs.editable_div) {
|
||||||
this.showPlaceholder(!this.value);
|
this.showPlaceholder(!this.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user