-
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
Image block captions disappear offscreen when mousing over resize handles (in Safari) #15924
Comments
I'm able to replicate this very strange bug 😂 |
Thanks for confirming, Mel. cc @marekhrabe, in case you have any idea what's happening here. 😄 |
Oh wow. I did some trial and error toggling of styles in the dev tools. Removing these styles seems to resolve the issue: gutenberg/packages/block-library/src/image/editor.scss Lines 123 to 124 in fc2835e
Not entirely sure what they do. |
I can also reproduce on Safari 13.0 (15608.1.27.40.1), macOS 10.15 Beta (19A487l) |
@jasmussen Can we remove these styles highlighted by @talldan? They were introduced by #7721 and I know floats can be tricky :) |
Hmm, this is tricky. The table rules are there to ensure that a floated non-resized image with a HUGE caption actually has its caption limited by the boundary of its container. The table property makes that happen. But it is kind of hacky, I do agree. I will take a look when I can, to see how to reproduce/fix this in a way that doesn't regress floated images with captions. |
So, here are visuals that explain why the block is display: table; Without it, a long caption is wider than the figure element. This is the same issue in the editor. HOWEVER, since this issue is editor only, we can potentially change the markup or CSS used to style the caption in the editor, so the issue is worked around. However this takes the two files out of sync, which isn't great. I would rather we keep exploring other solutions, because the floats + images + captions is a very very difficult challenge. |
Hi, |
I saw this happening on a friend's WordPress site as well. Part of it may be due to the new HEIC image format on iOS devices. It happens with those when he tries to upload them but not with JPG files. Might be due to HEIC not being supported in WP? |
I feel like this is definitely a Still present in WP 5.3.2 and Safari 13.0.5 |
This is still present in WordPress 5.4.2 + Gutenberg 8.7.0 + Safari 13.1.2. Adding a Note that the the I think setting a max-width on the containing There’s a problem with this approach if it can't be editor-only: the output HTML would force theme authors to override inline CSS of @jasmussen Thoughts? |
That is doable, yes, but it seems like an elaborate hack to what is essentially a Safari bug. That's not to say it shouldn't be addressed, it absolutely should, but just that it'd be nice to consider the above approach a "plan B" and seek a better plan A first. Can I ask you test the issue in Safari Technology Preview? Ideally we would also get someone to test in Safari 14, which is part of the next MacOS update. It'd be nice if the bug was solved there. I'll put on my todo list to test this myself, but I have a bit on my plate for the impending 5.5 release. |
Thank you for the followup. I will take a look again and see if I can find a workaround. |
I created a fix in #24540. |
Wonderful, thank you for researching and implementing this workaround. :) |
When an image has been resized, mousing over the resize handles (both horizontal or vertical) causes the caption to gradually move downward with each time your mouse passes over the handles. Happens only in Safari.
To reproduce:
GIF:
Tested on:
MacOS 10.14.5
Safari 12.1.1
Gutenberg 5.8.0
The text was updated successfully, but these errors were encountered: