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

Commit b60e8f2

Browse files
committed
checkbox fixed
1 parent a24aa14 commit b60e8f2

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/components/Cell.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default function DefaultCell(cellProperties: Cell) {
5050
LOGGER.debug(
5151
`default useEffect. dataType:${dataType} - value: ${contextValue.value} cellValue: ${cellValue}`
5252
);
53+
if (dirtyCell) {
54+
// End useEffect
55+
return;
56+
}
5357
switch (dataType) {
5458
case DataTypes.TASK:
5559
// Check if there are tasks in the cell
@@ -70,13 +74,16 @@ export default function DefaultCell(cellProperties: Cell) {
7074

7175
break;
7276
case DataTypes.MARKDOWN:
73-
containerCellRef.current.innerHTML = "";
74-
renderMarkdown(
75-
cellProperties,
76-
cellValue.toString(),
77-
containerCellRef.current,
78-
5
79-
);
77+
case DataTypes.TEXT:
78+
if (containerCellRef.current !== null) {
79+
containerCellRef.current.innerHTML = "";
80+
renderMarkdown(
81+
cellProperties,
82+
cellValue.toString(),
83+
containerCellRef.current,
84+
5
85+
);
86+
}
8087
break;
8188
default:
8289
// do nothing

src/components/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function CheckboxCell(props: CheckboxProps) {
1717
const note: NoteInfo = (cellProperties.row.original as any).__note__;
1818
/** state of cell value */
1919
const { contextValue, setContextValue } = useContext(CellContext);
20-
const [checked, setChecked] = useState(contextValue.value === 1);
20+
const [checked, setChecked] = useState(contextValue.value.toString() === "1");
2121
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
2222
const newValue = event.target.checked ? 1 : 0;
2323
// save on disk

0 commit comments

Comments
 (0)