mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-22 08:47:10 +08: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 { EditorContainer } from '@blocksuite/editor';
|
||||||
import type { Page } from '@blocksuite/store';
|
import type { Page } from '@blocksuite/store';
|
||||||
import { assertExists } from '@blocksuite/store';
|
import { assertExists } from '@blocksuite/store';
|
||||||
import { useEffect, useRef } from 'react';
|
import { CSSProperties, useEffect, useRef } from 'react';
|
||||||
|
|
||||||
import { BlockSuiteWorkspace } from '../../../shared';
|
import { BlockSuiteWorkspace } from '../../../shared';
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ export type EditorProps = {
|
|||||||
mode: 'page' | 'edgeless';
|
mode: 'page' | 'edgeless';
|
||||||
onInit?: (page: Page, editor: Readonly<EditorContainer>) => void;
|
onInit?: (page: Page, editor: Readonly<EditorContainer>) => void;
|
||||||
onLoad?: (page: Page, editor: EditorContainer) => void;
|
onLoad?: (page: Page, editor: EditorContainer) => void;
|
||||||
|
style?: CSSProperties;
|
||||||
};
|
};
|
||||||
|
|
||||||
import markdown from '../../../templates/Welcome-to-AFFiNE-Alpha-Downhills.md';
|
import markdown from '../../../templates/Welcome-to-AFFiNE-Alpha-Downhills.md';
|
||||||
@@ -112,5 +113,5 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
|||||||
container.removeChild(editor);
|
container.removeChild(editor);
|
||||||
};
|
};
|
||||||
}, [page]);
|
}, [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}
|
{header}
|
||||||
</BlockSuiteEditorHeader>
|
</BlockSuiteEditorHeader>
|
||||||
<Editor
|
<Editor
|
||||||
|
style={{
|
||||||
|
height: 'calc(100% - 60px)',
|
||||||
|
}}
|
||||||
blockSuiteWorkspace={blockSuiteWorkspace}
|
blockSuiteWorkspace={blockSuiteWorkspace}
|
||||||
mode={meta.mode ?? 'page'}
|
mode={meta.mode ?? 'page'}
|
||||||
page={page}
|
page={page}
|
||||||
|
|||||||
Reference in New Issue
Block a user