This is a migrated thread and some comments may be shown as answers.

contenteditable editor modifying given value when set.

1 Answer 149 Views
Editor
This is a migrated thread and some comments may be shown as answers.
thomas
Top achievements
Rank 1
thomas asked on 29 Sep 2013, 04:45 AM
If i create an editor widget and set its value to an img tag with a style attribute, the style attribute gets removed when I view the html for the editor (using the "viewHtml" command tool):

<div id="homeBanner" contenteditable="true" style="height: 160px; overflow: hidden; border: 1px dashed red; padding: 0">
    <img src="~/Content/TemplateImages/homeBanner1.png" style="width: 100%" />
</div>
    var bannerEditor = $("#homeBanner").data("kendoEditor");
    bannerEditor.value("<img alt='' src='/ImageBrowser/Image?path=homeBanner.png' style='width: 100%' />");

Expected edited value: <img alt='' src='/ImageBrowser/Image?path=homeBanner.png' style='width: 100%' />
Actual Result:  <img alt="" src="/ImageBrowser/Image?path=homeBanner.png" width="100" />

style tag is missing and width is missing the '%'.
This does not happen on all tags e.g. <p> does not get modified.
Is there a way to prevent this behavior? I want to set any image added to be 100% width.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 02 Oct 2013, 07:27 AM
HI Thomas,

 
Thank you for bringing this behavior to our attention. I have informed our dev team about it and it and they will investigate further what is the exact reason for current behavior.

I will follow you up in current thread when we have more information about it.

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
thomas
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or