Compare commits

...

2 commits

Author SHA1 Message Date
Surinna Curtis 4aa8d9d149 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
2017-09-02 08:24:55 -05:00
Surinna Curtis 6ba67f92c9 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.
2017-09-02 08:24:49 -05:00
2 changed files with 2 additions and 9 deletions

View file

@ -18,12 +18,6 @@ export default class SettingToggle extends React.PureComponent {
this.props.onChange(this.props.settingKey, target.checked);
}
onKeyDown = e => {
if (e.key === ' ') {
this.props.onChange(this.props.settingKey, !e.target.checked);
}
}
render () {
const { prefix, settings, settingKey, label, meta } = this.props;
const id = ['setting-toggle', prefix, ...settingKey].filter(Boolean).join('-');

View file

@ -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;
}