-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Button] Improve the disclosure API for button, allowing user to specify the direction the disclosure icon faces #2431
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
Conversation
cb31973
to
69b1ca2
Compare
69b1ca2
to
8391ad9
Compare
I think percy bugged out? 🤔 Showing visual diff that I can't see locally |
The code looks good. I just question the animation. Since we don't have this type of animation today it sort of took me by surprise. Maybe @sarahill or @johanstromqvist can share their thoughts. |
I'm cool without the animation too, just have it instantaneous, whichever most people prefer The implementation on today's OrderDetails page has no animation |
8391ad9
to
c5de50b
Compare
It's fine, it's because you added a new example. |
I lean towards no animation, but let's see what the people I pinged think. |
For the upwards caret I think we should use the proper icon CaretUpMinor instead of rendering CaretDownMinor upside down |
I chose to use the same icon (but rotate it) for the CSS transitions, otherwise it would be impossible If we want to go static and no animations, we could use CaretUpMinor |
I don't have any strong opinions on the animation. If it does a good job for the user, I don't think it's a problem that it's novel. Is it necessary? No I don't think so. The animation probably looks more prominent isolated in the GIF, than it would when implemented. If the caret rotates together and in sync with the expand/collapse, I think the eye will be drawn to the content, not the caret. |
Good to ship? Anyone 2nd ✅ ? |
c3e3373
to
a3a2dd1
Compare
Small example of the animation with popover content. Definitely echo @johanstromqvist that at least for me, the eye is drawn to the content and the animation is not as prominent. Makes the whole interaction feel more "fluid" in my opinion. |
a3a2dd1
to
1c6ffe6
Compare
…ify the direction the disclosure icon faces, CSS transition to animate when the prop changes
1c6ffe6
to
d189453
Compare
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.
For posterity: 👍
WHY are these changes introduced?
We have a need to use a
Button
to control the collapsed/expanded state of aCollapsible
. When the collapsible is collapsed, we want to sayShow more
with downwards caret. When expanded, we want to sayShow less
with upwards caret.The previous API is respected, so this is purely an opt-in enhancement
The icon will animate via CSS transition
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes