Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): block selection error when unloaded (#9511)

Saul-Mironeb17dac2201a4
diff --git a/blocksuite/affine/components/src/block-selection/index.ts b/blocksuite/affine/components/src/block-selection/index.ts
index 975b76027a..b0715a4332 100644
--- a/blocksuite/affine/components/src/block-selection/index.ts
+++ b/blocksuite/affine/components/src/block-selection/index.ts
@@ -54,7 +54,9 @@ export class BlockSelection extends SignalWatcher(LitElement) {
protected override updated(_changedProperties: PropertyValues): void {
super.updated(_changedProperties);
- this.style.display = this.block.selected?.is('block') ? 'block' : 'none';
+ if (this.block) {
+ this.style.display = this.block.selected?.is('block') ? 'block' : 'none';
+ }
}
@property({ attribute: false })