UploadArea: update deprecated e.keyCode --> e.key

This commit is contained in:
Alex Gleason 2023-04-21 12:28:44 -05:00
parent fc6eba91ac
commit 7ea9f0ad86
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -17,11 +17,9 @@ interface IUploadArea {
/** Component to display when a file is dragged over the UI. */
const UploadArea: React.FC<IUploadArea> = ({ 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();