Skip to content

Commit

Permalink
Components: Remove redundant DropdownMenu logic
Browse files Browse the repository at this point in the history
Built into Dropdown.
  • Loading branch information
aduth committed Mar 16, 2018
1 parent 1902a65 commit 9b851cc
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions components/dropdown-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
import { keycodes } from '@wordpress/utils';

/**
* Internal dependencies
*/
Expand All @@ -17,8 +12,6 @@ import Dashicon from '../dashicon';
import Dropdown from '../dropdown';
import { NavigableMenu } from '../navigable-container';

const { DOWN } = keycodes;

function DropdownMenu( {
icon = 'menu',
label,
Expand All @@ -34,13 +27,6 @@ function DropdownMenu( {
className="components-dropdown-menu"
contentClassName="components-dropdown-menu__popover"
renderToggle={ ( { isOpen, onToggle } ) => {
const openOnArrowDown = ( event ) => {
if ( ! isOpen && event.keyCode === DOWN ) {
event.preventDefault();
event.stopPropagation();
onToggle();
}
};
return (
<IconButton
className={
Expand All @@ -50,7 +36,6 @@ function DropdownMenu( {
}
icon={ icon }
onClick={ onToggle }
onKeyDown={ openOnArrowDown }
aria-haspopup="true"
aria-expanded={ isOpen }
label={ label }
Expand Down

0 comments on commit 9b851cc

Please sign in to comment.