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

DropdownMenuV2: invert animation direction #63443

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Jul 11, 2024

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
Copy link

github-actions bot commented Jul 11, 2024

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 <[email protected]>
Co-authored-by: tyxla <[email protected]>

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
Copy link
Member

@tyxla tyxla left a comment

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 🚀

@@ -11,6 +11,7 @@
- `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
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
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
Copy link

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
61 checks passed
@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 <[email protected]>
Co-authored-by: tyxla <[email protected]>
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 <[email protected]>
Co-authored-by: tyxla <[email protected]>
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