fix: title behavior on BlockSuite editor (#1264)

This commit is contained in:
Himself65
2023-03-02 11:38:17 -06:00
committed by GitHub
parent 32a1b7b8a3
commit eeb636e81c
20 changed files with 155 additions and 126 deletions

View File

@@ -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}
/>
);
};