Skip to content

Commit

Permalink
Fix responsiveness and placeholder height.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed May 28, 2021
1 parent 0dee2ad commit b04cae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions packages/block-library/src/legacy-widget/edit/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default function Form( {
} ) {
const ref = useRef();

const isMediumLargeViewport = useViewportMatch( 'small' );

// We only want to remount the control when the instance changes
// *externally*. For example, if the user performs an undo. To do this, we
// keep track of changes made to instance by the control itself and then
Expand Down Expand Up @@ -70,9 +72,14 @@ export default function Form( {

control.destroy();
};
}, [ id, idBase, instance, onChangeInstance, onChangeHasPreview ] );

const isMediumLargeViewport = useViewportMatch( 'small' );
}, [
id,
idBase,
instance,
onChangeInstance,
onChangeHasPreview,
isMediumLargeViewport,
] );

if ( isWide && isMediumLargeViewport ) {
return (
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/legacy-widget/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
// When wide widget is selected it opens in a popover but its container should still have a bit of height.
.is-selected {
.wp-block-legacy-widget__container {
min-height: 30px;
padding: $grid-unit-10 $grid-unit-15;
min-height: 50px;
}
}

0 comments on commit b04cae5

Please sign in to comment.