Skip to content

Commit

Permalink
Merge pull request #5528 from WordPress/fix/navigable-menu-arrow-navi…
Browse files Browse the repository at this point in the history
…gation-ie11

Refactored some Array.include usages to use lodash includes. Array.includes does not work on IE11.
  • Loading branch information
jorgefilipecosta authored Mar 9, 2018
2 parents 09a6116 + 21c956f commit 0ec3408
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/navigable-container/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External Dependencies
*/
import { omit, noop } from 'lodash';
import { omit, noop, includes } from 'lodash';

/**
* WordPress Dependencies
Expand Down Expand Up @@ -138,9 +138,9 @@ export class NavigableMenu extends Component {
previous = [ LEFT, UP ];
}

if ( next.includes( keyCode ) ) {
if ( includes( next, keyCode ) ) {
return 1;
} else if ( previous.includes( keyCode ) ) {
} else if ( includes( previous, keyCode ) ) {
return -1;
}
};
Expand Down
4 changes: 2 additions & 2 deletions edit-post/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import createSelector from 'rememo';
import { some } from 'lodash';
import { includes, some } from 'lodash';

/**
* Internal dependencies
Expand All @@ -29,7 +29,7 @@ export function getEditorMode( state ) {
export function isEditorSidebarOpened( state ) {
const activeGeneralSidebar = getPreference( state, 'activeGeneralSidebar', null );

return [ 'edit-post/document', 'edit-post/block' ].includes( activeGeneralSidebar );
return includes( [ 'edit-post/document', 'edit-post/block' ], activeGeneralSidebar );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions editor/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ function buildInserterItemFromBlockType( state, enabledBlockTypes, blockType ) {
return null;
}

const blockTypeIsDisabled = Array.isArray( enabledBlockTypes ) && ! enabledBlockTypes.includes( blockType.name );
const blockTypeIsDisabled = Array.isArray( enabledBlockTypes ) && ! includes( enabledBlockTypes, blockType.name );
if ( blockTypeIsDisabled ) {
return null;
}
Expand Down Expand Up @@ -1132,7 +1132,7 @@ function buildInserterItemFromReusableBlock( enabledBlockTypes, reusableBlock )
return null;
}

const blockTypeIsDisabled = Array.isArray( enabledBlockTypes ) && ! enabledBlockTypes.includes( 'core/block' );
const blockTypeIsDisabled = Array.isArray( enabledBlockTypes ) && ! includes( enabledBlockTypes, 'core/block' );
if ( blockTypeIsDisabled ) {
return null;
}
Expand Down

0 comments on commit 0ec3408

Please sign in to comment.