Skip to content
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

Lighter block DOM: Group #20586

Merged
merged 1 commit into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/block-library/src/group/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
*/
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { InnerBlocks, __experimentalUseColors } from '@wordpress/block-editor';
import {
InnerBlocks,
__experimentalUseColors,
__experimentalBlock as Block,
} from '@wordpress/block-editor';
import { useRef } from '@wordpress/element';

function GroupEdit( { hasInnerBlocks, className } ) {
Expand All @@ -28,7 +32,7 @@ function GroupEdit( { hasInnerBlocks, className } ) {
{ InspectorControlsColorPanel }
<BackgroundColor>
<TextColor>
<div className={ className } ref={ ref }>
<Block.div className={ className } ref={ ref }>
<div className="wp-block-group__inner-container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later it would be great to see if/how we can remove this div and instead rely on a more declarative way for InnerBlocks wide/full/left/right/center alignments support.

<InnerBlocks
renderAppender={
Expand All @@ -37,7 +41,7 @@ function GroupEdit( { hasInnerBlocks, className } ) {
}
/>
</div>
</div>
</Block.div>
</TextColor>
</BackgroundColor>
</>
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const settings = {
align: [ 'wide', 'full' ],
anchor: true,
html: false,
lightBlockWrapper: true,
},
transforms: {
from: [
Expand Down