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

Commit 3610b04

Browse files
committed
doubleClick on cell events
1 parent 7949e2b commit 3610b04

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

src/components/cellTypes/CalendarCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const CalendarCell = (calendarProps: CellComponentProps) => {
101101
) : (
102102
<span
103103
className={`${c("calendar tabIndex")}`}
104-
onClick={handleSpanOnClick}
104+
onDoubleClick={handleSpanOnClick}
105105
style={{ width: column.getSize() }}
106106
onKeyDown={(e) => {
107107
if (e.key === "Enter") {

src/components/cellTypes/CalendarTimeCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const CalendarTimeCell = (calendarTimeProps: CellComponentProps) => {
103103
<span
104104
className={`${c("calendar tabIndex")}`}
105105
style={{ width: column.getSize() }}
106-
onClick={handleSpanOnClick}
106+
onDoubleClick={handleSpanOnClick}
107107
onKeyDown={(e) => {
108108
if (e.key === "Enter") {
109109
e.preventDefault();

src/components/cellTypes/CheckboxCell.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function CheckboxCell(props: CellComponentProps) {
2727

2828
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
2929
const newValue = event.target.checked;
30+
editCheckbox(newValue);
31+
};
32+
33+
const editCheckbox = (newValue: boolean) => {
3034
const newCell = ParseService.parseRowToLiteral(
3135
checkboxRow,
3236
tableColumn,
@@ -47,6 +51,13 @@ function CheckboxCell(props: CellComponentProps) {
4751
<div
4852
key={`checkbox-div-${row.index}`}
4953
className={`${c("checkbox tabIndex")}`}
54+
tabIndex={0}
55+
onKeyDown={(e) => {
56+
if (e.key === "Enter") {
57+
e.preventDefault();
58+
editCheckbox(!checkboxCell);
59+
}
60+
}}
5061
>
5162
<input
5263
type="checkbox"

src/components/cellTypes/RelationCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const RelationCell = (mdProps: CellComponentProps) => {
108108
) : (
109109
<span
110110
ref={containerCellRef}
111-
onClick={handleOnClick}
111+
onDoubleClick={handleOnClick}
112112
style={{ width: column.getSize() }}
113113
className={c(
114114
getAlignmentClassname(

src/components/cellTypes/SelectCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const SelectCell = (popperProps: CellComponentProps) => {
142142
["tabIndex"]
143143
)
144144
)}
145-
onClick={() => setShowSelect(true)}
145+
onDoubleClick={() => setShowSelect(true)}
146146
style={{ width: column.getSize() }}
147147
onKeyDown={(e) => {
148148
if (e.key === "Enter") {

src/components/cellTypes/TagsCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const TagsCell = (tagsProps: CellComponentProps) => {
146146
["tabIndex", "tags-container"]
147147
)
148148
)}
149-
onClick={() => setShowSelectTags(true)}
149+
onDoubleClick={() => setShowSelectTags(true)}
150150
style={{ width: column.getSize() }}
151151
key={`tags-${row.index}-${tableColumn.key}`}
152152
onKeyDown={(e) => {

0 commit comments

Comments
 (0)