Skip to content

Commit

Permalink
BlockManagerCategory: Fix styles for indeterminate (#45564)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka authored Nov 7, 2022
1 parent 5d2e14a commit eadcf16
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/edit-post/src/components/block-manager/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@ function BlockManagerCategory( { title, blockTypes } ) {
const titleId = 'edit-post-block-manager__category-title-' + instanceId;

const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;

let ariaChecked;
if ( isAllChecked ) {
ariaChecked = 'true';
} else if ( checkedBlockNames.length > 0 ) {
ariaChecked = 'mixed';
} else {
ariaChecked = 'false';
}
const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;

return (
<div
Expand All @@ -92,7 +84,7 @@ function BlockManagerCategory( { title, blockTypes } ) {
checked={ isAllChecked }
onChange={ toggleAllVisible }
className="edit-post-block-manager__category-title"
aria-checked={ ariaChecked }
indeterminate={ isIndeterminate }
label={ <span id={ titleId }>{ title }</span> }
/>
<BlockTypesChecklist
Expand Down

0 comments on commit eadcf16

Please sign in to comment.