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. */
|
/** Component to display when a file is dragged over the UI. */
|
||||||
const UploadArea: React.FC<IUploadArea> = ({ active, onClose }) => {
|
const UploadArea: React.FC<IUploadArea> = ({ active, onClose }) => {
|
||||||
const handleKeyUp = (e: KeyboardEvent) => {
|
const handleKeyUp = (e: KeyboardEvent) => {
|
||||||
const keyCode = e.keyCode;
|
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
switch (keyCode) {
|
switch (e.key) {
|
||||||
case 27:
|
case 'Escape':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onClose();
|
onClose();
|
||||||
|
|
Loading…
Reference in a new issue