Skip to content

Commit

Permalink
Make the active item noticeable
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Sep 13, 2018
1 parent af04493 commit 6d92309
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/dropdown-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function DropdownMenu( {
controlSet.map( ( control, indexOfControl ) => (
<IconButton
key={ [ indexOfSet, indexOfControl ].join() }

onClick={ ( event ) => {
if ( control.isDisabled ) {
return;
Expand All @@ -89,7 +88,10 @@ function DropdownMenu( {
} }
className={ classnames(
'components-dropdown-menu__menu-item',
{ 'has-separator': indexOfSet > 0 && indexOfControl === 0 }
{
'has-separator': indexOfSet > 0 && indexOfControl === 0,
'is-active': control.isActive,
},
) }
icon={ control.icon }
role="menuitem"
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/dropdown-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
right: 0;
height: 1px;
}

&:not(:disabled).is-active > svg {
@include formatting-button-style__active;
}
}
}

0 comments on commit 6d92309

Please sign in to comment.