From ca8192084de1733edc0222e6382754d1aec94259 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 27 Jan 2021 15:38:51 -0600 Subject: [PATCH] restore docs position after hide/show Previously, the docs iframe was removed from the DOM when the docs were hidden. This caused the docs to always go back to the main page when shown. This fixes it by using CSS to hide the docs instead of removing them from the DOM. However, this comes with its own complications regarding maintaining the scroll position. --- src/components/App.tsx | 95 +++++++++++++++++++++++++++++++++++------ src/components/app.scss | 6 +++ 2 files changed, 87 insertions(+), 14 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 2a982ba1..46276288 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -22,7 +22,7 @@ function App(): JSX.Element {
setDragging(true)} onDragEnd={(): void => setDragging(false)} percentage={true} @@ -48,19 +48,86 @@ function App(): JSX.Element {
- {showDocs && ( -
- {dragging &&
} -