diff --git a/libs/components/editor-core/src/recast-block/property.ts b/libs/components/editor-core/src/recast-block/property.ts index c830c5e30..e8f010426 100644 --- a/libs/components/editor-core/src/recast-block/property.ts +++ b/libs/components/editor-core/src/recast-block/property.ts @@ -248,10 +248,8 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => { }; const removeValue = (propertyId: RecastPropertyId) => { - return recastItem.setProperty(TABLE_VALUES_KEY, { - ...props, - [propertyId]: null, - }); + const { [propertyId]: omitted, ...restProps } = props; + return recastItem.setProperty(TABLE_VALUES_KEY, restProps); }; return { getAllValue, getValue, setValue, removeValue }; }; diff --git a/libs/components/editor-core/src/recast-block/types/index.ts b/libs/components/editor-core/src/recast-block/types/index.ts index e1a097ebe..e7e44d347 100644 --- a/libs/components/editor-core/src/recast-block/types/index.ts +++ b/libs/components/editor-core/src/recast-block/types/index.ts @@ -18,6 +18,7 @@ type VariantBlock = Omit< value: Props[T] ): Promise; setProperties(value: Partial): Promise; + removeProperty(key: T): Promise; }; export type RecastBlock = VariantBlock;