-
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
Fix: Image block - Lightbox Button position #67042
base: trunk
Are you sure you want to change the base?
Fix: Image block - Lightbox Button position #67042
Conversation
Although, this will take care of 99% of use cases. However, notice the last image. I was blocked as to how to handle the positioning in an extremely small image. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
1 similar comment
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Fixes: #66958
Why?
The button's absolute positioning, determined by top and right values, is influenced by several factors. However, in some scenarios, the resulting position can be suboptimal.
For a standard Image block, the positioning generally works well. But when the Image block adopts a non-default layout, especially within nested containers, the positioning becomes inconsistent and erratic.
How?
This PR adds on to the logic of calculating the buttons's position relatively to the size of the image inside the figure tag and sets default minimum positions of the button.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Recording.2024-11-15.at.10.08.25.PM.mov