Skip to content

Commit

Permalink
Highlight selected item when it's a single selection tree
Browse files Browse the repository at this point in the history
  • Loading branch information
mdperez86 committed Jan 16, 2023
1 parent 42e6d06 commit 2a0480e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Expand Up @@ -3,6 +3,12 @@ $control-size: clac( $gap - $gap-smaller );
.experimental-woocommerce-tree-item {
margin: 0;

&--highlighted {
> .experimental-woocommerce-tree-item__heading {
background-color: #f6f7f7;
}
}

&__heading {
display: flex;
flex-grow: 1;
Expand Down
Expand Up @@ -35,7 +35,12 @@ export const TreeItem = forwardRef( function ForwardedTreeItem(
{ ...treeItemProps }
className={ classNames(
treeItemProps.className,
'experimental-woocommerce-tree-item'
'experimental-woocommerce-tree-item',
{
'experimental-woocommerce-tree-item--highlighted':
! selection.multiple &&
selection.checkedStatus === 'checked',
}
) }
>
<div
Expand Down

0 comments on commit 2a0480e

Please sign in to comment.