-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
CustomSelectControlV2: animate select popover appearance #63343
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
60004c1
to
b65c7ee
Compare
Thanks for sweating these details. I would expect since this is an element that opens downwards, that the animation reflect that. Right now it appears heavy on the opacity fade, and looks like it animates upwards. |
Perhaps if we delay the |
@@ -13,6 +13,13 @@ import { chevronIconSize } from '../select-control/styles/select-control-styles' | |||
import { fontSizeStyles } from '../input-control/styles/input-control-styles'; | |||
import type { CustomSelectButtonSize } from './types'; | |||
|
|||
// TODO: extract to common utils and apply to relevant components | |||
const ANIMATION_PARAMS = { | |||
SLIDE_AMOUNT: '2px', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be increased in order to make it more obvious that the select options are dropping down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you changed it to starting from - SLIDE_AMOUNT
, it looks good actually 👍 Nice touch!
Hey @jasmussen
Updated the animation to slide down, instead of up. cscv2.animation.v2.mp4
I'm not sure I understand what tweak you're suggesting to improve the fade. Also, the opening animation is copied from |
That feels substantially better! Outside of exploring actual "roll out" animations to animate the height of the dropdown from zero to its max-height, this one feels good to go as a first step. |
Thank you! I'll merge as soon as this PR gets an approval.
That should be possible soon, when the |
Flaky tests detected in 449a066. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9872610839
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice addition 👍 👏 🚀
packages/components/CHANGELOG.md
Outdated
@@ -41,6 +41,7 @@ | |||
- `CustomSelectControlV2`: keep item checkmark top aligned. ([#63230](https://github.com/WordPress/gutenberg/pull/63230)) | |||
- `CustomSelectControlV2`: keep legacy arrow down behavior only for legacy wrapper. ([#62919](https://github.com/WordPress/gutenberg/pull/62919)) | |||
- `CustomSelectControlV2`: fix trigger button font size. ([#63131](https://github.com/WordPress/gutenberg/pull/63131)) | |||
- `CustomSelectControlV2`: animate select popover appearance. ([#63343](https://github.com/WordPress/gutenberg/pull/63343)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After rebasing to the latest trunk
, we need to move this up under Unreleased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -13,6 +13,13 @@ import { chevronIconSize } from '../select-control/styles/select-control-styles' | |||
import { fontSizeStyles } from '../input-control/styles/input-control-styles'; | |||
import type { CustomSelectButtonSize } from './types'; | |||
|
|||
// TODO: extract to common utils and apply to relevant components | |||
const ANIMATION_PARAMS = { | |||
SLIDE_AMOUNT: '2px', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you changed it to starting from - SLIDE_AMOUNT
, it looks good actually 👍 Nice touch!
449a066
to
27297a0
Compare
…3343) * CustomSelectControlV2: animate select popover appearance * CHANGELOG * Change from slide up to slide down * update CHANGELOG --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
What?
Part of #55023
Animate the select popover appearance in the new version of
CustomSelectControl
Why?
To make UI interactions feel more polished and to uniform the component with the direction taken in other components.
How?
Using CSS animations to add a fade + slide down animation when the select popover appears
Note
For now, the slide direction in the animation will always be downwards. I tried to detect when
Ariakit
"flips" the popover from bottom to top for lack of space, so that I could apply a "slide down" animation instead, but I couldn't extract that information from the ariakit store (I tried the same technique used in theDropdownMenuV2
component.Testing Instructions
CustomSelectControlV2
Storybook default or legacy examplesreduced motion
. Open and close the select popover again, and make sure that it doesn't animate.Screenshots or screencast
cscv1.animation.mp4
cscv2.animation.v2.mp4