Skip to content

Commit

Permalink
removes the dev mode access key binding safeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Apr 18, 2019
1 parent 8a8fe0d commit 5c7659c
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/components/src/keyboard-shortcuts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ class KeyboardShortcuts extends Component {
this.mousetrap = new Mousetrap( keyTarget );

forEach( this.props.shortcuts, ( callback, key ) => {
if ( process.env.NODE_ENV === 'development' ) {
const keys = key.split( '+' );
const modifiers = new Set( keys.filter( ( value ) => value.length > 1 ) );
const hasAlt = modifiers.has( 'alt' );
const hasShift = modifiers.has( 'shift' );

if (
( modifiers.size === 1 && hasAlt ) ||
( modifiers.size === 2 && hasAlt && hasShift )
) {
throw new Error( `Cannot bind ${ key }. Alt and Shift+Alt modifiers are reserved for character input.` );
}
}

const { bindGlobal, eventName } = this.props;
const bindFn = bindGlobal ? 'bindGlobal' : 'bind';
this.mousetrap[ bindFn ]( key, callback, eventName );
Expand Down

0 comments on commit 5c7659c

Please sign in to comment.