logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: aebebdc5d1967e2110a9caafc3238c8b8ec055c4
parent: 05e4728de781209d13405240eca0dd4f3ef6baa8
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Mon, 19 Jun 2017 01:50:56 +0200

Debounce autosuggestions (#3836)

* Debounce autosuggestions

* Remove duplicate import

Diffstat:

Mapp/javascript/mastodon/features/compose/components/compose_form.js4++--
1 file 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 @@ -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;