Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9e39548

Browse files
author
Luke Barnard
committed
Fix a couple of bugs with EditableItemList
- fix entering the same thing twice (which had the bug of not emptying the "new" field) - fix editing items in the list (which would stack overflow because of typo)
1 parent 1938a76 commit 9e39548

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/views/elements/EditableItemList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = React.createClass({
104104
if (value.length === 0) {
105105
this.onItemRemoved(index);
106106
} else {
107-
this.onItemEdited(value, index);
107+
this.props.onItemEdited(value, index);
108108
}
109109
},
110110

src/components/views/elements/EditableText.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ module.exports = React.createClass({
6565
},
6666

6767
componentWillReceiveProps: function(nextProps) {
68-
if (nextProps.initialValue !== this.props.initialValue) {
68+
if (nextProps.initialValue !== this.props.initialValue ||
69+
nextProps.initialValue !== this.value
70+
) {
6971
this.value = nextProps.initialValue;
7072
if (this.refs.editable_div) {
7173
this.showPlaceholder(!this.value);

0 commit comments

Comments
 (0)