Skip to content

Commit 11e1ccb

Browse files
committed
fix(useDoubleClick): make it OR decision
otherwise the single click already does a potential state change in the actual application (e.g. url change) and the double click is never registered
1 parent 77d33b1 commit 11e1ccb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: src/table/Row/useDoubleClick.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ const useDoubleClickBase = ({
2121

2222
const handleDoubleClick = (event: any) => {
2323
if (onDoubleClick) {
24-
if (clickCount.current === 0) {
25-
onSingleClick(event);
26-
}
27-
2824
clickCount.current += 1;
2925

3026
setTimeout(() => {
31-
if (clickCount.current === 2) onDoubleClick(event);
27+
if (clickCount.current === 1) onSingleClick(event);
28+
else if (clickCount.current === 2) onDoubleClick(event);
3229

3330
clickCount.current = 0;
34-
}, 300);
31+
}, 100);
3532
}
3633
};
3734

0 commit comments

Comments
 (0)