From 2f39c07a5ac8c2cf2452af4e8c20031a3165a35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Fri, 20 Jan 2023 14:53:29 +0100 Subject: [PATCH] (core) Preserving scroll position on Raw Data Page Summary: On Raw Data page, when there are multiple tables, the scroll position shouldn't be changed when a table is opened and closed. Test Plan: Existing tests Reviewers: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3770 --- app/client/components/RawDataPage.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/client/components/RawDataPage.ts b/app/client/components/RawDataPage.ts index bd9b11ca..ce52cde2 100644 --- a/app/client/components/RawDataPage.ts +++ b/app/client/components/RawDataPage.ts @@ -42,10 +42,12 @@ export class RawDataPage extends Disposable { public buildDom() { return cssContainer( - dom('div', this._gristDoc.behavioralPromptsManager.attachTip('rawDataPage', {hideArrow: true})), - dom('div', - dom.create(DataTables, this._gristDoc), - dom.create(DocumentUsage, this._gristDoc.docPageModel), + cssPage( + dom('div', this._gristDoc.behavioralPromptsManager.attachTip('rawDataPage', {hideArrow: true})), + dom('div', + dom.create(DataTables, this._gristDoc), + dom.create(DocumentUsage, this._gristDoc.docPageModel) + ), // We are hiding it, because overlay doesn't have a z-index (it conflicts with a searchbar and list buttons) dom.hide(this._lightboxVisible) ), @@ -101,8 +103,13 @@ export class RawDataPopup extends Disposable { } const cssContainer = styled('div', ` - overflow-y: auto; + height: 100%; + overflow: hidden; position: relative; +`); + +const cssPage = styled('div', ` + overflow-y: auto; height: 100%; padding: 32px 64px 24px 64px; @media ${mediaSmall} {