Fix autocomplete delay text field not accepting text
SettingsStore.setValue is async (fire&forget) however getValueAt is cached. Theory was supposed to be that getValueAt local echos, however the animation loop of React is probably just too fast to actually make the local echo happen. Fixes https://github.com/vector-im/riot-web/issues/9907
This commit is contained in:
parent
380639516b
commit
345dbce6e4
1 changed files with 3 additions and 1 deletions
|
@ -66,6 +66,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
|||
autoLaunchSupported: false,
|
||||
minimizeToTray: true,
|
||||
minimizeToTraySupported: false,
|
||||
autocompleteDelay: SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -98,6 +99,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
|||
};
|
||||
|
||||
_onAutocompleteDelayChange = (e) => {
|
||||
this.setState({autocompleteDelay: e.target.value});
|
||||
SettingsStore.setValue("autocompleteDelay", null, SettingLevel.DEVICE, e.target.value);
|
||||
};
|
||||
|
||||
|
@ -139,7 +141,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
|||
{minimizeToTrayOption}
|
||||
{autoLaunchOption}
|
||||
<Field id={"autocompleteDelay"} label={_t('Autocomplete delay (ms)')} type='number'
|
||||
value={SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10)}
|
||||
value={this.state.autocompleteDelay}
|
||||
onChange={this._onAutocompleteDelayChange} />
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue