-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add support for orientation-based block movers to core/social-links #48452
Conversation
Size Change: +33 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
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.
This is great, but the attributes.layout?.orientation
is undefined for new Social Icon blocks. What if we add the following?
orientation: attributes.layout?.orientation ?? 'horizontal',
The default state is always horizontal, even though the attribute is technically undefined. That way the movers are correct on new blocks.
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.
Flaky tests detected in 465b761. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4284040984
|
…48452) * Add check for orientation * Add fallback
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: f3a7279 |
What?
Currently, when you select a social link the block movers are always vertical arrows. The "up" arrow moves the block to the left, and the "down" arrow moves the block to the right.
Closes #48451.
Why?
It's confusing that the up icon moves a social link block to the left.
How?
Add
orientation
prop to core/social-linksuseInnerBlocksProps
, based on the block'slayout.orientation
value.If
vertical
orientation, the block movers will render up/down icons. Ifhorizontal
orientation, the block movers will render left/right icons.Testing Instructions
Screenshots or screencast
Movers render vertically or horizontally, based on layout orientation:
CleanShot.2023-02-24.at.18.50.06.mp4