fix(core): make right-sidebar scrollable (#8830)

This commit is contained in:
CatsJuice
2024-11-18 08:47:12 +00:00
parent bd7c422c46
commit 9642566086
3 changed files with 29 additions and 6 deletions

View File

@@ -44,3 +44,7 @@ export const affineDocViewport = style({
export const scrollbar = style({
marginRight: '4px',
});
export const sidebarScrollArea = style({
height: '100%',
});

View File

@@ -302,19 +302,39 @@ const DetailPageImpl = memo(function DetailPageImpl() {
)}
<ViewSidebarTab tabId="properties" icon={<PropertyIcon />}>
<DocPropertySidebar />
<Scrollable.Root className={styles.sidebarScrollArea}>
<Scrollable.Viewport>
<DocPropertySidebar />
</Scrollable.Viewport>
<Scrollable.Scrollbar />
</Scrollable.Root>
</ViewSidebarTab>
<ViewSidebarTab tabId="journal" icon={<TodayIcon />}>
<EditorJournalPanel />
<Scrollable.Root className={styles.sidebarScrollArea}>
<Scrollable.Viewport>
<EditorJournalPanel />
</Scrollable.Viewport>
<Scrollable.Scrollbar />
</Scrollable.Root>
</ViewSidebarTab>
<ViewSidebarTab tabId="outline" icon={<TocIcon />}>
<EditorOutlinePanel editor={editorContainer} />
<Scrollable.Root className={styles.sidebarScrollArea}>
<Scrollable.Viewport>
<EditorOutlinePanel editor={editorContainer} />
</Scrollable.Viewport>
<Scrollable.Scrollbar />
</Scrollable.Root>
</ViewSidebarTab>
<ViewSidebarTab tabId="frame" icon={<FrameIcon />}>
<EditorFramePanel editor={editorContainer} />
<Scrollable.Root className={styles.sidebarScrollArea}>
<Scrollable.Viewport>
<EditorFramePanel editor={editorContainer} />
</Scrollable.Viewport>
<Scrollable.Scrollbar />
</Scrollable.Root>
</ViewSidebarTab>
<GlobalPageHistoryModal />

View File

@@ -24,10 +24,9 @@ export const sidebarContainerInner = style({
export const sidebarBodyTarget = style({
display: 'flex',
flexDirection: 'column',
height: 0,
flex: 1,
width: '100%',
height: '100%',
overflow: 'hidden',
alignItems: 'center',
});