Fix some React errors

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-06-30 10:41:39 +01:00
parent 35c0c3142f
commit d774d96290
2 changed files with 5 additions and 5 deletions

View file

@ -121,8 +121,8 @@ export default class EditableItemList extends React.Component {
return ( return (
<form onSubmit={this._onItemAdded} autoComplete={false} <form onSubmit={this._onItemAdded} autoComplete={false}
noValidate={true} className="mx_EditableItemList_newItem"> noValidate={true} className="mx_EditableItemList_newItem">
<Field id="newEmailAddress" label={this.props.placeholder} <Field id="newAddress" label={this.props.placeholder}
type="text" autoComplete="off" value={this.props.newItem} type="text" autoComplete="off" value={this.props.newItem || ""}
onChange={this._onNewItemChanged} onChange={this._onNewItemChanged}
/> />
<AccessibleButton onClick={this._onItemAdded} kind="primary"> <AccessibleButton onClick={this._onItemAdded} kind="primary">
@ -135,11 +135,11 @@ export default class EditableItemList extends React.Component {
render() { render() {
const editableItems = this.props.items.map((item, index) => { const editableItems = this.props.items.map((item, index) => {
if (!this.props.canRemove) { if (!this.props.canRemove) {
return <li>{item}</li>; return <li key={item}>{item}</li>;
} }
return <EditableItem return <EditableItem
key={index} key={item}
index={index} index={index}
value={item} value={item}
onRemove={this._onItemRemoved} onRemove={this._onItemRemoved}

View file

@ -139,7 +139,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
{minimizeToTrayOption} {minimizeToTrayOption}
{autoLaunchOption} {autoLaunchOption}
<Field id={"autocompleteDelay"} label={_t('Autocomplete delay (ms)')} type='number' <Field id={"autocompleteDelay"} label={_t('Autocomplete delay (ms)')} type='number'
value={SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay')} value={SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10)}
onChange={this._onAutocompleteDelayChange} /> onChange={this._onAutocompleteDelayChange} />
</div> </div>
</div> </div>