From e54e1a8691483f1d336231314130d9822481b3be Mon Sep 17 00:00:00 2001 From: Harshith Pabbati Date: Fri, 22 May 2020 19:19:47 +0530 Subject: [PATCH] fix: trigger edit variables on first render (#1545) --- packages/graphiql/src/components/VariableEditor.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/graphiql/src/components/VariableEditor.tsx b/packages/graphiql/src/components/VariableEditor.tsx index 45cd2d6dd41..ead706393bc 100644 --- a/packages/graphiql/src/components/VariableEditor.tsx +++ b/packages/graphiql/src/components/VariableEditor.tsx @@ -51,7 +51,7 @@ export class VariableEditor extends React.Component { editor: (CM.Editor & { options: any }) | null = null; cachedValue: string; private _node: HTMLElement | null = null; - ignoreChangeEvent: boolean; + ignoreChangeEvent: boolean = false; constructor(props: VariableEditorProps) { super(props); @@ -59,7 +59,6 @@ export class VariableEditor extends React.Component { // editor is updated, which can later be used to protect the editor from // unnecessary updates during the update lifecycle. this.cachedValue = props.value || ''; - this.ignoreChangeEvent = true; } componentDidMount() {