Prevent Box From Appearing Around Img in Editor

1 Answer 110 Views
Editor
Scott
Top achievements
Rank 1
Iron
Scott asked on 12 Aug 2022, 07:31 PM

I am using the kendo editor to allow users to insert custom html images directly into their document by clicking inside the doc. I do this by calling:

        editor.exec('insertText', { text: '#C#' });

 and then replacing that text with an img element: 

"<img src='../../../../assets/Artwork/Tag-Orange.svg' title='' height='15.25' id='' class='save_image_tag' />"

My problem is two fold: Whenever the user clicks in the editor to insert an image, the kendo editor shows a resizing box around the image:


I don't want this box to appear at all. In addition, even when the contenteditable is set to false for the editor, the user can still click on the images and a box around it will appear. I would like to prevent this from happening. Is this possible?

1 Answer, 1 is accepted

Sort by
0
Accepted
Scott
Top achievements
Rank 1
Iron
answered on 24 Aug 2022, 05:39 PM
I solved this problem by adding a click event listener to the editor and using an if statement to determine if the event.target is an IMG. If so, I call event.stopPropagation(). It works decently well for now. 
Tags
Editor
Asked by
Scott
Top achievements
Rank 1
Iron
Answers by
Scott
Top achievements
Rank 1
Iron
Share this question
or