From 5c7659c2260028953a61ee5553d581a3c3b49e84 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Thu, 18 Apr 2019 15:51:33 +0300 Subject: [PATCH] removes the dev mode access key binding safeguard --- .../components/src/keyboard-shortcuts/index.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/components/src/keyboard-shortcuts/index.js b/packages/components/src/keyboard-shortcuts/index.js index d4b12867e08b6f..05316e69edcf3e 100644 --- a/packages/components/src/keyboard-shortcuts/index.js +++ b/packages/components/src/keyboard-shortcuts/index.js @@ -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 );