From 014097a97e4cd03a6980a7fe74d44e1d099d89a4 Mon Sep 17 00:00:00 2001 From: Lipis Date: Tue, 1 Dec 2020 23:36:06 +0200 Subject: [PATCH] refactor: Stop using the deprecated keyCode (#2426) Co-authored-by: Lipis Co-authored-by: David Luzar --- src/actions/actionAlign.tsx | 30 ++--- src/actions/actionCanvas.tsx | 20 +-- src/actions/actionDistribute.tsx | 10 +- src/actions/actionDuplicateSelection.tsx | 2 +- src/actions/actionExport.tsx | 10 +- src/actions/actionGroup.tsx | 20 +-- src/actions/actionMenu.tsx | 4 +- src/actions/actionSelectAll.ts | 2 +- src/actions/actionStyles.ts | 10 +- src/actions/actionZindex.tsx | 36 +++--- src/components/Actions.tsx | 5 +- src/components/App.tsx | 20 +-- src/components/ColorPicker.tsx | 12 +- src/components/RoomDialog.tsx | 5 +- src/keys.ts | 65 +++++++--- src/shapes.tsx | 17 +-- .../regressionTests.test.tsx.snap | 120 +++++++++--------- src/tests/binding.test.tsx | 5 +- src/tests/helpers/ui.ts | 56 ++++---- src/tests/move.test.tsx | 7 +- src/tests/regressionTests.test.tsx | 82 ++++++------ 21 files changed, 257 insertions(+), 281 deletions(-) diff --git a/src/actions/actionAlign.tsx b/src/actions/actionAlign.tsx index d5140edc8..d4bc1008f 100644 --- a/src/actions/actionAlign.tsx +++ b/src/actions/actionAlign.tsx @@ -52,11 +52,8 @@ export const actionAlignTop = register({ commitToHistory: true, }; }, - keyTest: (event) => { - return ( - event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_UP - ); - }, + keyTest: (event) => + event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === KEYS.ARROW_UP, PanelComponent: ({ elements, appState, updateData }) => (