mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix: title behavior on BlockSuite editor (#1264)
This commit is contained in:
@@ -68,7 +68,7 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
||||
const title =
|
||||
localStorage.getItem(kFirstPage) === null ? exampleTitle : undefined;
|
||||
const pageBlockId = page.addBlockByFlavour('affine:page', {
|
||||
title,
|
||||
title: new page.Text(title),
|
||||
});
|
||||
page.addBlockByFlavour('affine:surface', {}, null);
|
||||
const frameId = page.addBlockByFlavour('affine:frame', {}, pageBlockId);
|
||||
@@ -113,5 +113,12 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
||||
container.removeChild(editor);
|
||||
};
|
||||
}, [page]);
|
||||
return <div className="editor-wrapper" style={props.style} ref={ref} />;
|
||||
return (
|
||||
<div
|
||||
data-testid={`editor-${props.blockSuiteWorkspace.room}-${props.page.id}`}
|
||||
className="editor-wrapper"
|
||||
style={props.style}
|
||||
ref={ref}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -57,6 +57,7 @@ export const PageDetailEditor: React.FC<PageDetailEditorProps> = ({
|
||||
style={{
|
||||
height: 'calc(100% - 60px)',
|
||||
}}
|
||||
key={pageId}
|
||||
blockSuiteWorkspace={blockSuiteWorkspace}
|
||||
mode={meta.mode ?? 'page'}
|
||||
page={page}
|
||||
|
||||
Reference in New Issue
Block a user