UploadArea: update deprecated e.keyCode --> e.key
This commit is contained in:
parent
fc6eba91ac
commit
7ea9f0ad86
1 changed files with 2 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue