Fix an error where React doesn't like value=null on a select

This only happens when there are no canonical aliases for a room.
pull/21833/head
Travis Ralston 2018-10-19 14:18:05 -06:00
parent 2ec9745939
commit 49efefa630
1 changed files with 2 additions and 1 deletions

View File

@ -220,8 +220,9 @@ module.exports = React.createClass({
let canonical_alias_section; let canonical_alias_section;
if (this.props.canSetCanonicalAlias) { if (this.props.canSetCanonicalAlias) {
let found = false; let found = false;
const canonicalValue = this.state.canonicalAlias || "";
canonical_alias_section = ( canonical_alias_section = (
<select onChange={this.onCanonicalAliasChange} value={this.state.canonicalAlias}> <select onChange={this.onCanonicalAliasChange} value={canonicalValue}>
<option value="" key="unset">{ _t('not specified') }</option> <option value="" key="unset">{ _t('not specified') }</option>
{ {
Object.keys(self.state.domainToAliases).map((domain, i) => { Object.keys(self.state.domainToAliases).map((domain, i) => {