From 7ea9f0ad86f9e1f5dba550471612ab93e2890f71 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 21 Apr 2023 12:28:44 -0500 Subject: [PATCH] UploadArea: update deprecated e.keyCode --> e.key --- app/soapbox/features/ui/components/upload-area.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/soapbox/features/ui/components/upload-area.tsx b/app/soapbox/features/ui/components/upload-area.tsx index 42f363749..8eba75ed5 100644 --- a/app/soapbox/features/ui/components/upload-area.tsx +++ b/app/soapbox/features/ui/components/upload-area.tsx @@ -17,11 +17,9 @@ interface IUploadArea { /** Component to display when a file is dragged over the UI. */ const UploadArea: React.FC = ({ active, onClose }) => { const handleKeyUp = (e: KeyboardEvent) => { - const keyCode = e.keyCode; - if (active) { - switch (keyCode) { - case 27: + switch (e.key) { + case 'Escape': e.preventDefault(); e.stopPropagation(); onClose();