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.
This commit is contained in:
Surinna Curtis 2017-08-31 22:32:03 -05:00
parent a0294c8880
commit 6ba67f92c9

View File

@ -12,13 +12,12 @@ export default class UploadArea extends React.PureComponent {
}; };
handleKeyUp = (e) => { handleKeyUp = (e) => {
e.preventDefault();
e.stopPropagation();
const keyCode = e.keyCode; const keyCode = e.keyCode;
if (this.props.active) { if (this.props.active) {
switch(keyCode) { switch(keyCode) {
case 27: case 27:
e.preventDefault();
e.stopPropagation();
this.props.onClose(); this.props.onClose();
break; break;
} }