mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: editor overflow (#1253)
This commit is contained in:
@@ -3,7 +3,7 @@ import { BlockHub } from '@blocksuite/blocks';
|
||||
import { EditorContainer } from '@blocksuite/editor';
|
||||
import type { Page } from '@blocksuite/store';
|
||||
import { assertExists } from '@blocksuite/store';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { CSSProperties, useEffect, useRef } from 'react';
|
||||
|
||||
import { BlockSuiteWorkspace } from '../../../shared';
|
||||
|
||||
@@ -13,6 +13,7 @@ export type EditorProps = {
|
||||
mode: 'page' | 'edgeless';
|
||||
onInit?: (page: Page, editor: Readonly<EditorContainer>) => void;
|
||||
onLoad?: (page: Page, editor: EditorContainer) => void;
|
||||
style?: CSSProperties;
|
||||
};
|
||||
|
||||
import markdown from '../../../templates/Welcome-to-AFFiNE-Alpha-Downhills.md';
|
||||
@@ -112,5 +113,5 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
||||
container.removeChild(editor);
|
||||
};
|
||||
}, [page]);
|
||||
return <div className="editor-wrapper" ref={ref} />;
|
||||
return <div className="editor-wrapper" style={props.style} ref={ref} />;
|
||||
};
|
||||
|
||||
@@ -54,6 +54,9 @@ export const PageDetailEditor: React.FC<PageDetailEditorProps> = ({
|
||||
{header}
|
||||
</BlockSuiteEditorHeader>
|
||||
<Editor
|
||||
style={{
|
||||
height: 'calc(100% - 60px)',
|
||||
}}
|
||||
blockSuiteWorkspace={blockSuiteWorkspace}
|
||||
mode={meta.mode ?? 'page'}
|
||||
page={page}
|
||||
|
||||
Reference in New Issue
Block a user