Skip to content

Commit

Permalink
Fix: Show resizer on "Media & Text" block on unified toolbar mode (Wo…
Browse files Browse the repository at this point in the history
…rdPress#10913)

## Description
Fixes: WordPress#10895
On unified toolbar mode, it was not possible to resize the media on Media & Text block.
During the elaboration of WordPress#9416 this bug was addressed but I think during subsequent rebases and changes more concretely the usage of our abstracted Resizable box we had a regression.

This PR applies exactly the same fix that was applied in spacer block to the Media & Text block.


## How has this been tested?
I checked it is possible to resize the media in Media & Text block in all modes including the unified toolbar.
  • Loading branch information
jorgefilipecosta authored and antpb committed Oct 26, 2018
1 parent 6d6554e commit 01d049f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,15 @@ class MediaTextEdit extends Component {
attributes,
className,
backgroundColor,
isSelected,
setAttributes,
setBackgroundColor,
} = this.props;
const { mediaPosition, mediaWidth } = attributes;
const temporaryMediaWidth = this.state.mediaWidth;
const classNames = classnames( className, {
'has-media-on-the-right': 'right' === mediaPosition,
'is-selected': isSelected,
[ backgroundColor.class ]: backgroundColor.class,
} );
const widthString = `${ temporaryMediaWidth || mediaWidth }%`;
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/media-text/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ figure.block-library-media-text__media-container {
display: none;
}

.editor-block-list__block.is-selected,
.editor-block-list__block.is-focused {
.wp-block-media-text.is-selected {
.editor-media-container__resizer .components-resizable-box__handle {
display: block;
}
Expand Down

0 comments on commit 01d049f

Please sign in to comment.