Skip to content

Commit

Permalink
fix(ui): check if click by keydown
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed Dec 12, 2022
1 parent 2486b12 commit 8eb70ca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/ui/src/components/root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ export function DRoot(props: DRootProps): JSX.Element | null {
windowRef,
'click',
(e) => {
ROOT_DATA.clickEvent = {
time: performance.now(),
e,
};
// Check if click by keydown.
if (!(e.clientX === 0 && e.clientY === 0)) {
ROOT_DATA.clickEvent = {
time: performance.now(),
e,
};
}
},
{ capture: true }
);
Expand Down

0 comments on commit 8eb70ca

Please sign in to comment.