diff --git a/blocksuite/framework/store/src/model/block/flat-sync-controller.ts b/blocksuite/framework/store/src/model/block/flat-sync-controller.ts index 7c58734bb6..ce60588204 100644 --- a/blocksuite/framework/store/src/model/block/flat-sync-controller.ts +++ b/blocksuite/framework/store/src/model/block/flat-sync-controller.ts @@ -72,6 +72,7 @@ export class FlatSyncController { if (key in proxy) { return; } + if (value === undefined) return; proxy[key] = value; }); } diff --git a/blocksuite/framework/store/src/model/block/sync-controller.ts b/blocksuite/framework/store/src/model/block/sync-controller.ts index 50c817e5b6..55346347f1 100644 --- a/blocksuite/framework/store/src/model/block/sync-controller.ts +++ b/blocksuite/framework/store/src/model/block/sync-controller.ts @@ -302,7 +302,9 @@ export class SyncController { if (key in props) return; const yValue = native2Y(value); - this.yBlock.set(`prop:${key}`, yValue); + if (value !== undefined) { + this.yBlock.set(`prop:${key}`, yValue); + } props[key] = this._getPropsProxy(key, yValue); }); }