Skip to content

Commit

Permalink
Fix File block resize glitches (#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

1 comment on commit f91339e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in f91339e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12676667318
📝 Reported issues:

Please sign in to comment.