Skip to content

DropdownMenuV2: invert animation direction - #63443

Merged
ciampo merged 3 commits into
trunkfrom
fix/dropdown-menu-v2-animation
Jul 12, 2024
Merged

ciampo merged 3 commits into
trunkfrom
fix/dropdown-menu-v2-animation

Conversation

@ciampo

@ciampo ciampo commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

What?

Apply feedback received on CustomSelectControl's popover animation in #63343 to DropdownMenuV2 and invert the direction of the popover enter animation based on the popover placement.

Why?

For consistency across the different components.

How?

By swapping left/right and up/down enter animation directions in code,

Testing Instructions

Open the Storybook examples for DropdownMenuV2, and play with the dropdown popover (both the main one, and the sub-menu ones). Make sure that the popover animates "away from the trigger" — if the popover opens below the trigger, it should slide down; if it opens to the right of the trigger, it should animate towards the right.

Note: the applied popover "placement" exposed by Ariakit doesn't take into account when the popover gets "flipped" for lack of viewport estate in the expected direction — and therefore we can not easily reflect that information in the animation.

Screenshots or screencast

Before (trunk) After (this PR)
ddmv2.animation.before.mp4
ddmv2.animation.after.mp4

@ciampo
ciampo requested a review from ajitbohra as a code owner July 11, 2024 15:08
@github-actions

github-actions Bot commented Jul 11, 2024 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo self-assigned this Jul 11, 2024
@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Jul 11, 2024
@ciampo
ciampo requested a review from a team July 11, 2024 15:12

@tyxla tyxla left a comment

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.

Tests well, code looks good ✅

Thank you 🚀

Comment thread packages/components/CHANGELOG.md Outdated
- `CustomSelectControl`: switch to ariakit-based implementation ([#63258](https://github.com/WordPress/gutenberg/pull/63258)).
- `CustomSelectControlV2`: animate select popover appearance. ([#63343](https://github.com/WordPress/gutenberg/pull/63343))
- `CustomSelectControlV2`: do not flip popover if legacy adapter. ([#63357](https://github.com/WordPress/gutenberg/pull/63357)).
- `CustomSelectControlV2`: invert animation direction. ([#63443](https://github.com/WordPress/gutenberg/pull/63443)).

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.

Isn't this an enhancement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is, but we usually log changes to private APIs in the Internal section

@ciampo
ciampo force-pushed the fix/dropdown-menu-v2-animation branch from 61b0bac to 74c3663 Compare July 12, 2024 14:01
@ciampo
ciampo enabled auto-merge (squash) July 12, 2024 14:02
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 74c3663.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9909119440
📝 Reported issues:

@ciampo
ciampo merged commit 48830b6 into trunk Jul 12, 2024
@ciampo
ciampo deleted the fix/dropdown-menu-v2-animation branch July 12, 2024 14:37
@github-actions github-actions Bot added this to the Gutenberg 18.9 milestone Jul 12, 2024
scruffian pushed a commit that referenced this pull request Jul 15, 2024
* DropdownMenuV2: invert animation direction

* CHANGELOG

* fix CHANGELOG

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
* DropdownMenuV2: invert animation direction

* CHANGELOG

* fix CHANGELOG

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
@ciampo ciampo mentioned this pull request Aug 20, 2024
43 of 58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants