-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use clientWidth when no width is available for cropper #27687
Conversation
Size Change: +5 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
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've tested this. Works to resolve the issue where I've encountered it. I didn't test my suggestion and don't see that omitting it would cause issues.
Aside: In part this review is for me to try out the github workflow. Thanks!
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 tested this as per instructions to replicate in #27145.
I found on master
the bug was still in evidence (except the image didn't disappear it was just very very small).
On this branch however the image remains as the correct size based on it's alignment.
I tested on Twenty Twenty One.
👍 Nice fix.
Fixes #27145
When the image has an align property the crop container's width becomes zero. When the image is having a set width the crop container inherits it, but when it has no width, the crop container is 100% of zero, because of the float, so it results in a zero width.
With this small change, we make the crop container always have at least the clientWidth value.