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

Fix Image block field to wrap the entire image across left and right alignments. #5937

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MostafaMagdyy
Copy link
Contributor

Fixes #5922 for the image field container to wrap the entire image in right and left alignment.

For full-width alignment, I think it's another issue itself. Disregard the field to wrap the entire image because the image is going outside the whole container and above the sidebar on the right if you try to drag its block. So, I do not think this PR should fix it, because it is not related to the failure of the wrapper to fill the whole image. Let me know if I should fix it in this PR, and I will do so. Also, please clarify how the full width should be, because I do not see any difference between it and when the image is aligned center with size=large, as both take size=100vw in getImageBlockSizes function.

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 7d5564b
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/660a9b627d0c3d000804b7f3

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit 7d5564b
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/660a9b625903e70008ed4340

@MostafaMagdyy
Copy link
Contributor Author

Please review this pull request. @stevepiercy ,@polyester, could you please take a look and provide your feedback? Thank you!

@stevepiercy
Copy link
Collaborator

@MostafaMagdyy the lint CI check fails. You must fix it before review will happen. See https://6.docs.plone.org/volto/contributing/linting.html

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just missing a space in the change log.

packages/volto/news/5922.bugfix Outdated Show resolved Hide resolved
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@MostafaMagdyy
Copy link
Contributor Author

@stevepiercy Thank you for your feedback. I have addressed all your comments and fixed all the issues. Additionally, here are the screenshots displaying the new behavior for left and right alignment.
oie_PHzGyA7xqc6d
oie_cLX8eZVwphge

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve, but this still needs review from a Volto Team member.

Copy link
Sponsor Member

@ichim-david ichim-david left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MostafaMagdyy you don't fully understand why the select area with the border around the image is as small as it is.
It's because of a float property.
That is useful when you want to have text to the right or left of your image.
Here is a demo on the current feature in action:
before-flex

and how it would function with your changes:
after-flex

You need some css that will affect the editing selected area alongside
extra code to have the text float to the left or right.

@MostafaMagdyy
Copy link
Contributor Author

@MostafaMagdyy you don't fully understand why the select area with the border around the image is as small as it is. It's because of a float property. That is useful when you want to have text to the right or left of your image. Here is a demo on the current feature in action: before-flex

and how it would function with your changes: after-flex

You need some css that will affect the editing selected area alongside extra code to have the text float to the left or right.

Thank you for your feedback.
Now i understand the importance of it and i will try to make the same behaviour as it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image block field fail to wrap the entire image across various alignments during editing.
3 participants