Repository navigation
Fix #22892 and print classnames in spacer block on editor side - #23235
Merged
Merged
Conversation
This was referenced Jun 17, 2020
Member
|
Rebased and merged 👍 |
Contributor
|
Hi there! I'm not sure this is the right fix. Right now the className is duplicated because it's also added by useBlockProps. the className prop explicit passing is not something we should stop doing. Why do we need this classname on the inner div? Isn't the outer div enough? |
Member
Author
|
I opened this PR pre-useBlockProps, and never tested it since it got merged and this block started using it. As far as i understand 0f09f1a#diff-2b919cfc2fabd55455cb2ca4c5c6a77a79c29b9def8b49deaa4cbeb01bc17a0c actually superseded this PR and it wasn't needed anymore. I think it's safe to revert this PR |
Contributor
|
@oxyc I'll revert this one then :) |
youknowriad
added a commit
that referenced
this pull request
Nov 4, 2020
youknowriad
added a commit
that referenced
this pull request
Nov 5, 2020
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.
Description
Fixes issue where css classes are not added to the spacer block on the editor side.
Unfortunately I couldn't find a way to make this into a light block so that the wrapper element isnt printed. Tested out #23034 but as I suspected it didn't work. @ellatrix is there a way to do this or would it somehow be possible if
useBlockProps()gets merged?How has this been tested?
Ran
wp.blocks.registerBlockStyle( 'core/spacer', { name: 'custom', label: 'Custom Style' } );and tested adding a spacer with the style and with a custom class name.Screenshots
Types of changes
Bug fix
Checklist: