From f9f0b424730e0fed88d70dfb953caeb23a74d896 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Sat, 27 Jan 2024 18:32:01 -0800 Subject: [PATCH] improve debug logging --- src/components/grid/grid.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/grid/grid.tsx b/src/components/grid/grid.tsx index e663917..e0812c8 100644 --- a/src/components/grid/grid.tsx +++ b/src/components/grid/grid.tsx @@ -111,13 +111,20 @@ function useKeyPress( ) { useEffect(() => { const listener = (eventRaw: Event) => { - console.log('eventRaw', eventRaw); - console.log('callback', callback); - console.log('key', key); - console.log('ctrlKey', ctrlKey); + console.log( + 'eventRaw', + eventRaw, + 'callback', + callback, + 'key', + key, + 'ctrlKey', + ctrlKey + ); // eslint-disable-next-line @typescript-eslint/no-explicit-any const event = eventRaw as any as KeyboardEvent; if (event.key === key && event.ctrlKey === ctrlKey) { + console.log(`calling event for ${key} ${ctrlKey}`); callback(event); } };