Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit b36b866

Browse files
committed
fix display some numbers
1 parent b30bb32 commit b36b866

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@rollup/plugin-typescript": "8.5.0",
2727
"@testing-library/jest-dom": "5.16.5",
2828
"@testing-library/react": "13.4.0",
29-
"@types/jest": "28.1.8",
29+
"@types/jest": "29.0.3",
3030
"@types/luxon": "3.0.1",
3131
"@types/node": "18.7.18",
3232
"@types/react": "18.0.20",
@@ -35,23 +35,23 @@
3535
"@types/react-datepicker": "4.4.2",
3636
"@types/react-dom": "18.0.6",
3737
"@types/react-window": "1.8.5",
38-
"@typescript-eslint/eslint-plugin": "5.36.2",
39-
"@typescript-eslint/parser": "5.36.2",
38+
"@typescript-eslint/eslint-plugin": "5.37.0",
39+
"@typescript-eslint/parser": "5.37.0",
4040
"eslint": "8.23.1",
41-
"jest": "28.1.3",
42-
"jest-mock-extended": "2.0.7",
41+
"jest": "29.0.3",
42+
"jest-mock-extended": "3.0.1",
4343
"obsidian": "0.15.9",
4444
"rollup": "2.79.0",
4545
"rollup-plugin-terser": "7.0.2",
4646
"rollup-plugin-typescript2": "0.34.0",
47-
"ts-jest": "28.0.8",
47+
"ts-jest": "29.0.1",
4848
"tslib": "2.4.0",
4949
"typescript": "4.8.3"
5050
},
5151
"dependencies": {
5252
"@emotion/styled": "11.10.4",
5353
"@mui/icons-material": "5.10.3",
54-
"@mui/material": "5.10.4",
54+
"@mui/material": "5.10.5",
5555
"@popperjs/core": "2.11.6",
5656
"@tanstack/match-sorter-utils": "8.1.1",
5757
"@tanstack/react-table": "8.5.13",

src/components/cellTypes/NumberCell.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ const NumberCell = (props: CellComponentProps) => {
2828
// onChange handler
2929
const handleOnChange: ChangeEventHandler<HTMLInputElement> = (event) => {
3030
// parse value to number
31-
const value = parseFloat(event.target.value);
32-
setEditableValue(value);
31+
setEditableValue(event.target.value);
3332
};
3433

3534
function persistChange(changedValue: number) {
@@ -51,7 +50,7 @@ const NumberCell = (props: CellComponentProps) => {
5150
};
5251

5352
const handleOnBlur = () => {
54-
persistChange(editableValue);
53+
persistChange(parseFloat(editableValue));
5554
setDirtyCell(false);
5655
};
5756

@@ -69,7 +68,9 @@ const NumberCell = (props: CellComponentProps) => {
6968
onClick={handleEditableOnclick}
7069
style={{ width: column.getSize() }}
7170
>
72-
{(numberRow[column.id] && numberRow[column.id].toString()) || ""}
71+
{(numberRow[column.id] !== undefined &&
72+
numberRow[column.id].toString()) ||
73+
""}
7374
</span>
7475
);
7576
};

0 commit comments

Comments
 (0)