Repository navigation
Site Editor: Fix the frame snapping to the mobile width when resized with the mouse - #86423
Conversation
Since re-resizable 6.9.17, a resize end resets a dimension missing from the `size` prop to `auto`. The frame passed only its height, so its width collapsed to the minimum width when the mouse was released. Pass the resized width back along with the height. Document the behavior in the ResizableBox README. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +4 B (0%) Total Size: 8.61 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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. Allows widget deletion to be undone in Page List converts to Navigation Links with entity bindings in
|
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET
The focus order change was reverted in re-resizable 6.10.1, so 6.11.2 does not include it. Describe the actual behavior change instead. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET
mirka
left a comment
There was a problem hiding this comment.
Should we add a test that drags the handle and checks the width after release? It did regress once, so it's perhaps worth covering.
Co-authored-by: Lena Morita <lena@jaguchi.com>
Co-authored-by: Lena Morita <lena@jaguchi.com>
Drag the frame's resize handle with the mouse and check that the width is kept after release, since this regressed with the re-resizable update. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8
|
Thanks for the review! The E2E tests have been added in d2073c5. |
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8
…rame test Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8
…with the mouse (#86423) * Site Editor: Keep the frame width after resizing it with the mouse Since re-resizable 6.9.17, a resize end resets a dimension missing from the `size` prop to `auto`. The frame passed only its height, so its width collapsed to the minimum width when the mouse was released. Pass the resized width back along with the height. Document the behavior in the ResizableBox README. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET * Site Editor: Remove the comment on the frame width passed to size Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET * Components: Correct the changelog entry for the re-resizable update The focus order change was reverted in re-resizable 6.10.1, so 6.11.2 does not include it. Describe the actual behavior change instead. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URxCxcL32yhVuFk2cET * Update changelog entry Co-authored-by: Lena Morita <lena@jaguchi.com> * Site Editor: Explain why the frame passes its width to size Co-authored-by: Lena Morita <lena@jaguchi.com> * Site Editor: Test that the frame keeps its width after a mouse resize Drag the frame's resize handle with the mouse and check that the width is kept after release, since this regressed with the re-resizable update. Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8 * Site Editor: Convert the resizable frame test to TypeScript Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8 * Site Editor: Remove the dependency group comment from the resizable frame test Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011g9URwcWfyF8Ue6TzN2FC8 --------- Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 8519483 |
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. Built from https://develop.svn.wordpress.org/trunk@65379 git-svn-id: http://core.svn.wordpress.org/trunk@64518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
What?
Fixes the site editor frame snapping to the minimum width when it is resized with the mouse.
site-editor-resize.mp4
Why?
#83754 updated
re-resizablefrom 6.9.0 to 6.11.2 while fixing peer dependency conflicts. Since bokuweb/re-resizable#797 (released in 6.9.17), when a resize ends, any dimension missing from thesizeprop is reset toauto.ResizableFramepasses only the height throughsize, so its width becameautoon mouse release and the frame shrank to itsminWidth. Resizing with the keyboard was not affected, because it passes both the width and the height.WordPress 7.1 still bundles
re-resizable6.9.0, so this regression first appears in WordPress 7.2. This fix needs to be backported to WordPress 7.2.How?
ResizableFramenow passes the resized width back tosizealong with the height. I checked every otherResizableBoxusage in Gutenberg, and none is affected.I also corrected the existing
re-resizableupdate entry in the components changelog. It said that the update renders the top and left handles before the content so focus order matches visual order, but that change was reverted in 6.10.1 (bokuweb/re-resizable#836). The entry now describes thesizebehavior change instead.It is also possible to keep the previous behavior inside
ResizableBox, but that takes a bit more work, so I did not do it here. It would need a change like this:Keeping the previous behavior in
ResizableBoxTesting Instructions
Use of AI Tools
Claude Code was used to investigate the cause and to draft the code change and this description.