You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user