-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 plugin doesn't handle width/height in attributes #11393
Comments
This is very important especially nowadays with PageSpeed Insights and Chrome's Lighthouse (among other 3rd party tools) which rate web page metrics for performance and other things and punish sites' scores for CLS (content layout shifts). An image without width and height attributes in 2023 is just completely outta the question. I understand the removal of the dialog window that CKE4/CKFinder had which allowed for setting multiple image attributes; but the width and height should be just automatic or there needs to be some exposed API like an event to listen on when an image is added so the attributes can be added easily. This was relatively easy to do in CKEditor 4 but appears overengineered in CK5 and so far I haven't found anything explaining on how to add a hook or something to add image attributes when an image is inserted into the editor. If there is a way to do this can you guys at least explain how we can do it? |
Yes, we will try to make it transparent and work out of the box for integrators :) cc: @mmotyczynska |
The implementation is close to completion, but we would love to hear some feedback. The details are gathered in the comment. |
🎉 This feature was merged to the In a comment in another issue, you can find more details about the changes. |
How do we turn this off? It doesn't play well with CSS. |
Believe me, it's much better to have the attributes and aspect ratio. You can easily make your images 'fluid' again by setting: img {
max-width: 100%;
height: auto;
} |
📝 Provide detailed reproduction steps (if any)
Recently we have improved GHS to preserve image width and height attributes #9916 but the Image plugin itself doesn't seem to handle them.
<p><img alt="oracle" height="13" src="
https://upload.wikimedia.org/wikipedia/commons/5/50/Oracle_logo.svg
" width="100" /></p>
✔️ Expected result
CKEditor displays image with proper width/height
❌ Actual result
Editor sets style for width/height to 0 and values from attributes are not taken into account.
What is the actual result of the above steps?
❓ Possible solution
If you have ideas, you can list them here. Otherwise, you can delete this section.
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: