Add support for orientation-based block movers to core/social-links#48452
Merged
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
|
ndiego
requested changes
Feb 26, 2023
Member
ndiego
left a comment
There was a problem hiding this comment.
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.
|
Flaky tests detected in 465b761. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4284040984
|
ntsekouras
pushed a commit
that referenced
this pull request
Feb 28, 2023
…48452) * Add check for orientation * Add fallback
Contributor
|
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: f3a7279 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
orientationprop to core/social-linksuseInnerBlocksProps, based on the block'slayout.orientationvalue.If
verticalorientation, the block movers will render up/down icons. Ifhorizontalorientation, 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