Fix room topics/names reseting when UserSetting re-renders
This reverts a fix to EditableText introduced in https://github.com/matrix-org/matrix-react-sdk/pull/1445 which introduced a bug that causes room name and topic to reset when UserSettings is rerendered because `initialValue != this.value` This also fixes the same bug originally fixed by #1445: >fix entering the same thing twice (which had the bug of not >emptying the "new" field) which, in other words meant that clicking "+" when adding a room alias would not reset the contents of the bottom-most alias in the list. The fix is to increment the `key` of the element, causing a new instance to be mounted instead of passing new props to the existing one.
This commit is contained in:
parent
48f03bfd86
commit
016e9176f6
2 changed files with 5 additions and 2 deletions
|
@ -61,7 +61,7 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
if (nextProps.initialValue !== this.props.initialValue || nextProps.initialValue !== this.value) {
|
||||
if (nextProps.initialValue !== this.props.initialValue) {
|
||||
this.value = nextProps.initialValue;
|
||||
if (this.refs.editable_div) {
|
||||
this.showPlaceholder(!this.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue