From 345dbce6e4f5b6b5188d0b45505dcc31f395b1bf Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 14 Jul 2019 23:28:23 -0600 Subject: [PATCH] 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 --- .../views/settings/tabs/user/PreferencesUserSettingsTab.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js index cd60a7e9a5..a645632dbc 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js @@ -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}