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();