about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/upload_area.js
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2017-09-02 09:27:16 -0500
committerEugen Rochko <eugen@zeonfederated.com>2017-09-02 16:27:16 +0200
commit8cc1ed3c556830092601425881384f8667dec437 (patch)
tree7c892de06cd1c736714641b5239318afb3390fd9 /app/javascript/mastodon/features/ui/components/upload_area.js
parent5e1e466da02e0ab18787e164777c4a459a209305 (diff)
Don't unconditionally call `preventDefault` and `stopPropagation` on all keyup events (#4777)
* 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.

* Remove workaround for fixed bug in SettingToggle

SettingToggle was toggling itself in response to keydown of space, and then the keyup was doing it again
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/upload_area.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/upload_area.js5
1 files 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 030c3db2e..dda28feeb 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;
       }