From 6ba67f92c98b8d9849b29d875ac258b6ba6cf02f Mon Sep 17 00:00:00 2001 From: Surinna Curtis Date: Thu, 31 Aug 2017 22:32:03 -0500 Subject: [PATCH] UploadArea should only preventDefault for Escape This will make accessibility for some things less effortful, since we won't have to define a prior event handler to do whatever should be happening by default. --- .../mastodon/features/ui/components/upload_area.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/ui/components/upload_area.js b/app/javascript/mastodon/features/ui/components/upload_area.js index 030c3db2ef..dda28feeb7 100644 --- a/app/javascript/mastodon/features/ui/components/upload_area.js +++ b/app/javascript/mastodon/features/ui/components/upload_area.js @@ -12,13 +12,12 @@ export default class UploadArea extends React.PureComponent { }; handleKeyUp = (e) => { - e.preventDefault(); - e.stopPropagation(); - const keyCode = e.keyCode; if (this.props.active) { switch(keyCode) { case 27: + e.preventDefault(); + e.stopPropagation(); this.props.onClose(); break; }