-
Notifications
You must be signed in to change notification settings - Fork 0
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
[28][29][31] Width and Height block settings #39
Open
PaulREnglish
wants to merge
12
commits into
main
Choose a base branch
from
fix/no-layout-alignment-override
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3daf7b4
fix: assign height and width a default value of null
PaulREnglish 8c657d8
fix(image-comparison): move block props into own function
PaulREnglish d7a2b22
Revert "fix(image-comparison): move block props into own function"
PaulREnglish 97c4c27
fix(image comparison): create function for getting container size
PaulREnglish 6edfadc
docs: fix invalid getContainerSize typehinting in docblock
PaulREnglish 1b5d327
fix(image-comparison): allows alignment settings to affect the block
PaulREnglish e304e01
docs: correct return param type in getContainerSize docblock
PaulREnglish 360a294
Merge branch 'fix/width-height-default-null' into fix/no-layout-align…
PaulREnglish 812ffc0
fix: fix alignment functionality on front end
PaulREnglish 30fe54b
fix: hide width/height settings when alignment is set
PaulREnglish 71f341a
docs: improve getContainerSize docblock description
PaulREnglish a95da67
Merge branch 'fix/width-height-default-null' into fix/no-layout-align…
PaulREnglish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think this function will be needed? If the
containerHeight
andcontainerWidth
attributes aren't set then the block just needs to respond to it's parent element, the nullish coalescing operator (??
) might hopefully be enough to handle this?I'm not sure where the
500px
default width and height values have come from as currently this will lead to a visual discrepancy between editor and frontend, steps to reproduce this;The block in editor will end up with the height of
500px
, if you then visit the frontend you'll see that the block is displaying as expected (height scaling with the width), are the500px
values required?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.
Thanks for the review! I added the
500px
values to make it backwards compatible as that was the default value used inblock.json
before I changed it tonull
. (See here)I'll have a look into the visual discrepancy and see what I can do about it.
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.
Hey @PaulREnglish thanks for the explanation, I think we may be able to avoid needing to do that and should try to avoid setting any width or height pixel values until the user specifically sets them and let the original image size then respond to it's container by default.
I'm not sure of the reason they were set to default to
500px
originally as well, I may be overlooking something here though but please let me know if I can assist with anything on this 👍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.
Will do thanks!