diff --git a/packages/graphiql/src/components/GraphiQL.tsx b/packages/graphiql/src/components/GraphiQL.tsx index 0912f8b810f..9e3f0109c45 100644 --- a/packages/graphiql/src/components/GraphiQL.tsx +++ b/packages/graphiql/src/components/GraphiQL.tsx @@ -1484,6 +1484,13 @@ export class GraphiQL extends React.Component { const docsSize = app.clientWidth - cursorPos; if (docsSize < 100) { + if (typeof this.props.onToggleDocs === 'function') { + this.props.onToggleDocs(!this.state.docExplorerOpen); + } + this._storage.set( + 'docExplorerOpen', + JSON.stringify(this.state.docExplorerOpen), + ); this.setState({ docExplorerOpen: false }); } else { this.setState({