-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Image sizes grow outside of block container #19424
Comments
This was discussed in today's Gutenberg Triage by the Design Team in slack. The suggestion is to limit the expansion of the image to within the block's edge (don't let it expand outside the block). This way it doesn't look broken. If the user would like to expand the image further, they can set the block to |
Taking a look at some of the code that is causing this: gutenberg/packages/block-library/src/image/edit.js Lines 594 to 599 in 6312ca7
How do you feel about the reasoning above for why this is allowed to be resized larger than the parent block? Essentially: If we updated the resizable to use @mapk commented above:
Agreed, and maybe this is enough for 3rd party themes as well? Or do we need to worry about keeping this |
Excellent digging into this, @Addison-Stavlo! Thanks for sharing this finding. 😄
I'm all for this, but I don't know enough about 3rd party theme development to make the call. Let's get some thoughts from @allancole, @kjellr, and @karmatosed on this one before going further. |
As we are only limiting in editor this won't be an issue with it as a theme can override in an editor style. |
The theme editor style override is done through css only? I am guessing they don't have the capability of altering the While a theme can override css, this If the resizer is fed a 'maxWidth' of 600, it won't matter if a theme overrides the CSS of the column and image block to be 800, the resizer will still be limited to 600. Similarly if the resizer is fed a Unless a 3rd party theme has the capability of directly changing the |
The PR mentioned above does this, it seems to be working well and should support changes made by 3rd party themes. |
This is a duplicate of #12168 Can we consolidate discussions there? |
I am not sure if this is expected behaviour but I found it a little weird. If you pick a large size image (or full width), by changing percentage you can end up with it popping out of the block container.
My expectation would be that it fits inside, but this might be ok as you are selecting a wider image that is bigger than container.
The text was updated successfully, but these errors were encountered: