Skip to content

Commit

Permalink
Components: Fix unwanted ToggleGroupControl backdrop vertical animati…
Browse files Browse the repository at this point in the history
…on (#59642)

* Components: Fix unwanted ToggleGroupControl backdrop vertical animation

* CHANGELOG

* Update test snapshots

Unlinked contributors: acicovic.

Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: andrewhayward <andrewhayward@git.wordpress.org>
  • Loading branch information
3 people committed Mar 6, 2024
1 parent 65666d3 commit 0f37efd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `HStack`, `VStack`: Stop passing invalid props to underlying element ([#59416](https://github.com/WordPress/gutenberg/pull/59416)).
- `Button`: Fix focus outline in disabled primary variant ([#59391](https://github.com/WordPress/gutenberg/pull/59391)).
- `Button`: Place `children` before the icon when `iconPosition` is `right` ([#59489](https://github.com/WordPress/gutenberg/pull/59489)).
- `ToggleGroupControl`: Fix unwanted backdrop vertical animation ([#59642](https://github.com/WordPress/gutenberg/pull/59642)).

### Internal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,13 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
</svg>
</div>
</button>
<div
class="emotion-15"
role="presentation"
style="opacity: 1;"
/>
<div>
<div
class="emotion-15"
role="presentation"
style="opacity: 1;"
/>
</div>
</div>
<div
class="emotion-10 emotion-11"
Expand Down Expand Up @@ -823,11 +825,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
</svg>
</div>
</button>
<div
class="emotion-15"
role="presentation"
style="opacity: 1;"
/>
<div>
<div
class="emotion-15"
role="presentation"
style="opacity: 1;"
/>
</div>
</div>
<div
class="emotion-10 emotion-11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,18 @@ function ToggleGroupControlOptionBase(
</WithToolTip>
{ /* Animated backdrop using framer motion's shared layout animation */ }
{ isPressed ? (
<motion.div
className={ backdropClasses }
transition={
shouldReduceMotion
? REDUCED_MOTION_TRANSITION_CONFIG
: undefined
}
role="presentation"
layoutId={ LAYOUT_ID }
/>
<motion.div layout layoutRoot>
<motion.div
className={ backdropClasses }
transition={
shouldReduceMotion
? REDUCED_MOTION_TRANSITION_CONFIG
: undefined
}
role="presentation"
layoutId={ LAYOUT_ID }
/>
</motion.div>
) : null }
</LabelView>
);
Expand Down

0 comments on commit 0f37efd

Please sign in to comment.