fix(core): fix falsy e2e (#6027)

This commit is contained in:
EYHN
2024-03-05 15:25:19 +00:00
parent 5d8dea084c
commit dce3b59c52

View File

@@ -205,7 +205,8 @@ export const BlocksuiteEditorContainer = forwardRef<
useEffect(() => { useEffect(() => {
if (blockElement) { if (blockElement) {
requestIdleCallback(() => { affineEditorContainerProxy.updateComplete
.then(() => {
if (mode === 'page') { if (mode === 'page') {
blockElement.scrollIntoView({ blockElement.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
@@ -221,9 +222,10 @@ export const BlocksuiteEditorContainer = forwardRef<
path: blockElement.path, path: blockElement.path,
}); });
selectManager.set([newSelection]); selectManager.set([newSelection]);
}); })
.catch(console.error);
} }
}, [blockElement, affineEditorContainerProxy.host?.selection, mode]); }, [blockElement, affineEditorContainerProxy, mode]);
return ( return (
<div <div