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(core): db property number cell should be cast to number (#8937)

pengx17f4f005bffb26
diff --git a/packages/frontend/core/src/modules/doc-info/views/database-properties/cells/number.tsx b/packages/frontend/core/src/modules/doc-info/views/database-properties/cells/number.tsx
index c183e87f44..8b88e60c4d 100644
--- a/packages/frontend/core/src/modules/doc-info/views/database-properties/cells/number.tsx
+++ b/packages/frontend/core/src/modules/doc-info/views/database-properties/cells/number.tsx
@@ -14,7 +14,11 @@ export const NumberCell = ({
<NumberValue
value={value}
onChange={v => {
- dataSource.cellValueChange(rowId, cell.property.id, v);
+ const value = Number(v);
+ if (isNaN(value)) {
+ return;
+ }
+ dataSource.cellValueChange(rowId, cell.property.id, value);
onChange?.(v);
}}
/>