Skip to content

Commit

Permalink
Fix File block resize glitches (WordPress#68372)
Browse files Browse the repository at this point in the history
* Fix File block’s resize width glitch

* Fix stuck width from resize at prior align

Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
stokesman and Mamaduka authored Jan 8, 2025
1 parent 0f18e11 commit f91339e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,12 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
<div { ...blockProps }>
{ displayPreviewInEditor && (
<ResizableBox
size={ { height: previewHeight } }
size={ { height: previewHeight, width: '100%' } }
minHeight={ MIN_PREVIEW_HEIGHT }
maxHeight={ MAX_PREVIEW_HEIGHT }
minWidth="100%"
grid={ [ 10, 10 ] }
// The horizontal grid value must be 1 or else the width may snap during a
// resize even though only vertical resizing is enabled.
grid={ [ 1, 10 ] }
enable={ {
top: false,
right: false,
Expand Down

0 comments on commit f91339e

Please sign in to comment.