Skip to content

Commit

Permalink
💄 Make "All" checkbox indeterminate
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
MatzeKitt committed Dec 7, 2024
1 parent f9ac71d commit 1089b9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
== Changelog ==

= 1.4.1 =
* We added an indeterminate visual display of the "All" checkbox, e.g. while selecting posts.
* We fixed displaying post type visibility settings inside the site editor.

= 1.4.0 =
Expand Down
13 changes: 13 additions & 0 deletions src/control/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,19 @@ const addControls = createHigherOrderComponent( ( BlockEdit ) => {
]
: false
}
indeterminate={
hidePosts &&
hidePosts[ type ] &&
! hidePosts[ type ][
'all'
] &&
Object.values(
hidePosts[ type ]
).some(
( item ) =>
item === true
)
}
value="all"
onChange={ ( value ) =>
onChangePostsAll(
Expand Down

0 comments on commit 1089b9a

Please sign in to comment.