diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-19 01:50:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 01:50:56 +0200 |
commit | aebebdc5d1967e2110a9caafc3238c8b8ec055c4 (patch) | |
tree | 63375f6624c5fd64bff9be8cfa19178418b5139d /app | |
parent | 05e4728de781209d13405240eca0dd4f3ef6baa8 (diff) |
Debounce autosuggestions (#3836)
* Debounce autosuggestions * Remove duplicate import
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/features/compose/components/compose_form.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 621ec43ab..8da3f8046 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -74,9 +74,9 @@ class ComposeForm extends ImmutablePureComponent { this.props.onClearSuggestions(); } - onSuggestionsFetchRequested = (token) => { + onSuggestionsFetchRequested = debounce((token) => { this.props.onFetchSuggestions(token); - } + }, 500, { trailing: true }) onSuggestionSelected = (tokenStart, token, value) => { this._restoreCaret = null; |