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

Clear/Stop style formatting

1 Answer 24 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David A.
Top achievements
Rank 1
David A. asked on 02 Apr 2014, 06:29 PM
Hi,

I have incorporated several custom styles similar to http://demos.telerik.com/kendo-ui/web/editor/styles.html, but the problem is that style continues when the user hits the enter key to start a new line.  The editor inserts a <p> tag with a <span style="mystyle"> from currently selected style.   This can be seen in the demo above by going to the end of the content, adding a new line of text, selecting a style, and then hitting enter. The only way to "get out" of the style is to go into html view, which I cannot expect my users to do.  

In my experience, the best way to use the styles (formatting) option in the editor is to highlight the text and choose the style.  After that, the style should no longer apply. Is it possible to tell the editor to stop using a style when the enter key is pressed?  Otherwise, would I be able to add a snippet to clear all formatting?

Thank you,
David A.

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 04 Apr 2014, 01:25 PM
Hi David,

Currently the functionality that you are looking for is not supported. You can detect if the enter key is pressed using the keydown event and the key detection that Kendo UI offers

keydown: function(e) {
  if(e.keyCode == 13){       
}

however there is not a built-in way to clear the stylesheet option set in the editor.

I would suggest you to check our uservoice section, where you can post this as a suggestion, so it will be considered for a future implementation.

Regards,
Kiril Nikolov
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
David A.
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or