From dc125f1e4d153bc19cd7b803e0cdff04f4b5265f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Mon, 28 Jan 2019 13:03:33 +0100 Subject: [PATCH] Made sure we only resetTypeahead if mounted --- public/app/features/explore/QueryField.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/public/app/features/explore/QueryField.tsx b/public/app/features/explore/QueryField.tsx index 24b8b8f5b16..d27213cea34 100644 --- a/public/app/features/explore/QueryField.tsx +++ b/public/app/features/explore/QueryField.tsx @@ -73,6 +73,7 @@ export class QueryField extends React.PureComponent { - this.setState({ - suggestions: [], - typeaheadIndex: 0, - typeaheadPrefix: '', - typeaheadContext: null, - }); - this.resetTimer = null; + if (this.mounted) { + this.setState({ + suggestions: [], + typeaheadIndex: 0, + typeaheadPrefix: '', + typeaheadContext: null, + }); + this.resetTimer = null; + } }; handleBlur = () => {