Skip to content

Commit

Permalink
fix: trigger edit variables on first render (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati authored May 22, 2020
1 parent 1bb7b0e commit e54e1a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/graphiql/src/components/VariableEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ export class VariableEditor extends React.Component<VariableEditorProps> {
editor: (CM.Editor & { options: any }) | null = null;
cachedValue: string;
private _node: HTMLElement | null = null;
ignoreChangeEvent: boolean;
ignoreChangeEvent: boolean = false;
constructor(props: VariableEditorProps) {
super(props);

// Keep a cached version of the value, this cache will be updated when the
// 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() {
Expand Down

0 comments on commit e54e1a8

Please sign in to comment.