Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting "Original Ratio" while cropping an image does not properly reset it. #69084

Open
3 of 6 tasks
yogeshbhutkar opened this issue Feb 7, 2025 · 1 comment · May be fixed by #69085
Open
3 of 6 tasks

Selecting "Original Ratio" while cropping an image does not properly reset it. #69084

yogeshbhutkar opened this issue Feb 7, 2025 · 1 comment · May be fixed by #69085
Assignees
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@yogeshbhutkar
Copy link
Contributor

Description

This issue was originally reported on Trac.

When the Original Ratio is selected while cropping an image, an incorrect ratio is applied to the Image block. Additionally, since the Original Ratio represents the default state, it should be pre-selected by default.

The issue occurs due to a minor typo in the following line:

Here, the key should be ratio instead of aspect, as the following code snippet destructures ratio, not aspect:

{ aspectRatios.map( ( { name, slug, ratio } ) => (

Step-by-step reproduction instructions

  1. Create an Image Block and pick an Image.
  2. From the Toolbar Controls toggle Crop then Aspect Ratio.
  3. Choose Original from Aspect Ratio.
  4. Observe that instead of maintaining the original ratio, it adds a fallback value.

Screenshots, screen recording, code snippet

Screen.Recording.2025-02-07.at.11.55.11.AM.mov

Environment info

  • WordPress Version: 6.8-alpha-59361
  • Gutenberg Version: Trunk
  • OS: macOS Sequoia

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@yogeshbhutkar yogeshbhutkar added the [Type] Bug An existing feature does not function as intended label Feb 7, 2025
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 7, 2025
@mikinchauhan
Copy link

Thank you, @yogeshbhutkar , for helping bring the issue from WordPress Core Trac #62912 to this platform.

@Mamaduka Mamaduka added the [Package] Block editor /packages/block-editor label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
3 participants