Skip to content

Commit

Permalink
ToggleGroupControl: Fix active background for zero value (#66855)
Browse files Browse the repository at this point in the history
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: mirka <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2024
1 parent 1e82c94 commit 0098e9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bug Fixes

- `Popover`: Fix missing label of the headerTitle Close button ([#66813](https://github.com/WordPress/gutenberg/pull/66813)).
- `ToggleGroupControl`: Fix active background for `0` value ([#66855](https://github.com/WordPress/gutenberg/pull/66855)).

### Enhancements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function UnconnectedToggleGroupControl(
const [ controlElement, setControlElement ] = useState< HTMLElement >();
const refs = useMergeRefs( [ setControlElement, forwardedRef ] );
const selectedRect = useTrackElementOffsetRect(
value ? selectedElement : undefined
value || value === 0 ? selectedElement : undefined
);
useAnimatedOffsetRect( controlElement, selectedRect, {
prefix: 'selected',
Expand Down

0 comments on commit 0098e9b

Please sign in to comment.