RAD Editor Paragraph style reset on enter

0 Answers 51 Views
Editor
Steve
Top achievements
Rank 1
Steve asked on 02 Aug 2023, 12:21 AM

I am trying to understand what configuration controls the paragraph style behaviour when enter is hit.

If I have applied any of the "Header 1" to "Header 6" paragraph styles, when I enter, the paragraph style is reset back to normal. The same happens if I use the <address> paragraph style.

However, most of the other paragraph styles do not reset but continue to leave it applied. Any custom paragraph style I add also leave the style applied when enter is hit.

Is there a configuration setting that is applied that determines which paragraph styles are reset and which ones are not when enter is hit?

Rumen
Telerik team
commented on 02 Aug 2023, 07:36 AM

Hi Steve,

The observed scenario is a browser behavior and can be reproduced outside of RadEditor in a standard editable div or editable iframe element. You can reproduce the same behavior in the following dojo demo -> run the demo and it will render an editable div and iframe where you can reproduce the same behavior as in RadEditor.

Default browser behavior of Chrome: Some paragraph styles, like "Header 1" to "Header 6" and <address>, are treated as block-level elements by default. When the cursor is placed at the end of a heading tag and you hit "Enter" to start a new paragraph, the browser interprets it as creating a new block-level element and therefore reset the style to the default paragraph style.

On the other hand, the menu and pre-block tags have different behavior and the Enter key creates a new menu/pre tag for each Enter key press.

No answers yet. Maybe you can help?

Tags
Editor
Asked by
Steve
Top achievements
Rank 1
Share this question
or