diff --git a/packages/graphql-playground-react/src/components/Playground/DocExplorer/GraphDocs.tsx b/packages/graphql-playground-react/src/components/Playground/DocExplorer/GraphDocs.tsx index 771dab2aa..41408e94e 100644 --- a/packages/graphql-playground-react/src/components/Playground/DocExplorer/GraphDocs.tsx +++ b/packages/graphql-playground-react/src/components/Playground/DocExplorer/GraphDocs.tsx @@ -224,43 +224,40 @@ class GraphDocs extends React.Component< onMouseDown={this.handleDocsResizeStart} />
- {docsOpen && ( -
-
- {emptySchema && {emptySchema}} - {!emptySchema && - schema && ( - - )} - {!emptySchema && - navStack.map((stack, index) => ( - - - - ))} -
+
+
+ {emptySchema && {emptySchema}} + {!emptySchema && + schema && ( + + )} + {navStack.map((stack, index) => ( + + + + ))}
- )} +
) } @@ -362,16 +359,17 @@ class GraphDocs extends React.Component< } } else { const obj = serializeRoot(this.props.schema) + const y = lastNavStack ? lastNavStack.y : 0 const element = getElementRoot( obj, - keyPressed === 'up' ? lastNavStack.y - 1 : lastNavStack.y + 1, + keyPressed === 'up' ? y - 1 : y + 1, ) if (element) { this.props.addStack( this.props.sessionId, element, 0, - keyPressed === 'up' ? lastNavStack.y - 1 : lastNavStack.y + 1, + keyPressed === 'up' ? y - 1 : y + 1, ) } }