(core) Fix scrollbar in code view

Summary:
The scrollbar wasn't properly positioned inside the
bounds of the main panel.

Test Plan: Manual.

Reviewers: jarek

Reviewed By: jarek

Subscribers: paulfitz, jarek

Differential Revision: https://phab.getgrist.com/D4357
This commit is contained in:
George Gevoian
2024-09-30 11:20:07 -04:00
parent 632cb8464b
commit d2714da224
4 changed files with 9 additions and 15 deletions

View File

@@ -1,8 +1,5 @@
.g-code-panel {
position:absolute;
width: 100%;
height: 100%;
margin: 10px;
padding: 10px;
overflow: auto;
}

View File

@@ -655,15 +655,10 @@ export class GristDoc extends DisposableWithEvents {
* Builds the DOM for this GristDoc.
*/
public buildDom() {
const isMaximized = Computed.create(this, use => use(this.maximizedSectionId) !== null);
const isPopup = Computed.create(this, use => {
return ['data', 'settings'].includes(use(this.activeViewId) as any) // On Raw data or doc settings pages
|| use(isMaximized) // Layout has a maximized section visible
|| Boolean(use(this._popupSectionOptions)); // Layout has a popup section visible
});
return cssViewContentPane(
testId('gristdoc'),
cssViewContentPane.cls("-contents", isPopup),
cssViewContentPane.cls("-special-page", use =>
['data', 'settings', 'code'].includes(use(this.activeViewId) as string)),
dom.maybe(this._isRickRowing, () => cssStopRickRowingButton(
cssCloseIcon('CrossBig'),
dom.on('click', () => {
@@ -2052,8 +2047,9 @@ const cssViewContentPane = styled('div', `
padding: 0px;
}
}
&-contents {
&-special-page {
overflow: hidden;
padding: 0px;
}
`);