Fix tags autocomplete deleting input with fast typing (#6448) [deploy]

This commit is contained in:
rhymes 2020-03-04 17:41:12 +01:00 committed by GitHub
parent 52b2a8f520
commit 196ac20669
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,9 +31,10 @@ class Tags extends Component {
constructor(props) {
super(props);
this.debouncedTagSearch = debounce(this.handleInput.bind(this), 150, {
leading: true,
});
// 250ms without invoking the function at the leading edge of the timeout
// NOTE: this seems the best combination of wait time and options to avoid
// flickering and text replacement during autocomplete
this.debouncedTagSearch = debounce(this.handleInput.bind(this), 250);
this.state = {
selectedIndex: -1,