Skip to content

Commit a1c30d9

Browse files
committed
feat: Enable image resizing on mobile devices
Allow resizing images on mobile. This reverts explicit disabling of the feature in Gutenberg based on reports in WordPress/gutenberg#2675. The resizing feature appears to work well enough today. We should contribute this change upstream.
1 parent b2ec745 commit a1c30d9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@wordpress/block-library/build-module/image/image.js b/node_modules/@wordpress/block-library/build-module/image/image.js
2+
index 473b653..8a52e9e 100644
3+
--- a/node_modules/@wordpress/block-library/build-module/image/image.js
4+
+++ b/node_modules/@wordpress/block-library/build-module/image/image.js
5+
@@ -282,7 +282,7 @@ export default function Image({
6+
const [hasImageErrored, setHasImageErrored] = useState(false);
7+
const hasNonContentControls = blockEditingMode === 'default';
8+
const isContentOnlyMode = blockEditingMode === 'contentOnly';
9+
- const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport;
10+
+ const isResizable = allowResize && hasNonContentControls && !isWideAligned;
11+
const imageSizeOptions = imageSizes.filter(({
12+
slug
13+
}) => image?.media_details?.sizes?.[slug]?.source_url).map(({

patches/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Existing patches should be described and justified here.
1212
- Disable `stripExperimentalSettings` in the `BlockEditorProvider` component so that the Patterns and Media inserter tabs function.
1313
- Allow setting popover props for the `Inserter` component, so we can improve the mobile screen reader experience by marking it as a modal dialog.
1414

15+
### `@wordpress/block-library`
16+
17+
- Enable image resizing on mobile devices by removing the `isLargeViewport` check from the `isResizable` condition in the `Image` component. The resizing feature appears to work well enough now, in contrast to the description in https://github.com/WordPress/gutenberg/issues/2675.
18+
1519
### `@wordpress/components`
1620

1721
- Apply workaround to `FormFileUpload` to address iOS Safari's lack of support for a wildcard `audio/*` MIME type. Can be removed once [the issue](https://github.com/WordPress/gutenberg/issues/70119) is resolved in a future release.

0 commit comments

Comments
 (0)