-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat(image): add aspect ratio option #3205
Conversation
🤖 Pull request artifacts
|
src/block-components/image/edit.js
Outdated
setAttributes( { imageHeight: value } ) | ||
if ( attributes.imageAspectRatio !== '' && attributes.imageWidth === '' ) { | ||
setAttributes( { imageWidth: 'auto' } ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to call setAttributes
only once when a value changes. In the block editor, whenever setAttributes
is called, it creates a new entry in the changes history, since it's called twice here, you'll have to undo two times.
For the card block, I would expect the Aspect Ratio to be present and should have an effect. So e.g. setting it to square should really make the image square |
Fixed the aspect ratio for card block, specifically For variation |
fixes #3200