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
This commit is contained in:
committed by
Eugen Rochko
parent
5e1e466da0
commit
8cc1ed3c55
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user