Skip to content

Commit

Permalink
fix: run onToggleDocs when setting docExplorerOpen to false (#1768)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiragKasat authored Feb 2, 2021
1 parent 7501b5c commit cb4debd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,13 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
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({
Expand Down

0 comments on commit cb4debd

Please sign in to comment.