Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- `CheckboxControl`: Fix disabled styles. [#77132](https://github.com/WordPress/gutenberg/pull/77132)
- `Textarea`: Fix disabled styles [#77129](https://github.com/WordPress/gutenberg/pull/77129).
- `Autocomplete`: Fix value comparison to avoid resetting block inserter in RTC ([#76980](https://github.com/WordPress/gutenberg/pull/76980)).
- `ValidatedRangeControl`: Fix `aria-label` rendered as `[object Object]` when `required` or `markWhenOptional` is set ([#77042](https://github.com/WordPress/gutenberg/pull/77042)).
Expand Down
12 changes: 12 additions & 0 deletions packages/components/src/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
// Ensure label is aligned with checkbox along X axis
line-height: var(--checkbox-input-size);
cursor: pointer;

.components-checkbox-control:has(:disabled) & {
cursor: default;
}
Comment on lines +21 to +23
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaking the set up here so it works better with #76786.

}

.components-checkbox-control__input[type="checkbox"] {
Expand Down Expand Up @@ -55,9 +59,17 @@
&:checked::before {
content: none;
}

&:disabled {
cursor: default;
}
}

.components-checkbox-control__input-container {
&:has(:disabled) {
opacity: 0.3;
}

position: relative;
display: inline-block;
margin-right: var(--checkbox-input-margin);
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/dataform/stories/layout-regular.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const fields: Field< SamplePost >[] = [
id: 'can_comment',
label: 'Allow people to leave a comment',
type: 'boolean',
Edit: 'checkbox',
Edit: 'toggle',
},
{
id: 'filesize',
Expand Down Expand Up @@ -356,14 +356,14 @@ const LayoutRegularComponent = ( {
'title',
'order',
'sticky',
'can_comment',
'author',
'status',
'reviewer',
'email',
'password',
'date',
'birthdate',
'can_comment',
'filesize',
'dimensions',
'tags',
Expand Down
Loading