Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Fix unwanted ToggleGroupControl backdrop vertical animation #59642

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -8,6 +8,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
Loading