mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +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}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user