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

RadEditor adds two p tags after pressing Enter

3 Answers 81 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Yuriy
Top achievements
Rank 1
Yuriy asked on 13 Oct 2015, 02:43 PM

Hi Guys,

Please try to perform the following on the RadEditor Demo Page:

1. Empty the editor using the HTML tab.

2. Go to the Design tab and press Enter

Result: two <p> tags appears.

3. Type any line and press Enter.

Result: the word is in a <p> tag, one more <p> tag under the word.

4. Press Enter.

Result: new two <p> tags appears.

Please take a look at this video for better understanding: https://dl.dropboxusercontent.com/u/101184853/Two_p_tags.swf

Please suggest how we can fix this issue.

3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 14 Oct 2015, 05:31 AM
Hello,

The described behavior is quite expected. If pressing enter does not produce a P element, how would be possible for the user to add empty lines into the content?

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yuriy
Top achievements
Rank 1
answered on 14 Oct 2015, 11:35 AM

Thank you, Ianko.

Well, that makes sense.

One more question is why the latest cursor position is moved down  - under the latest paragraph tag, after switching the tabs? It is reproducible if you click, for example, in the middle of the Editor window after returning to the Design Tab: http://screencast.com/t/YRmXhyCJOG

It would be logically if it was on the lowest paragraph, but not lower it, would not it? As you can see, this behavior produces two p tags after pressing the Enter button only once.

Best Regards,

Yuriy

0
Ianko
Telerik team
answered on 15 Oct 2015, 10:05 AM
Hi Yuriy,

The described behavior is mostly because it is the browser that controls the cursor position at this point. Thus, further logic to get whether the caret is in the correct would cause much more delay in the mode switching. Although text is being added outside of a paragraph, once enter is pressed this is getting corrected. Also, it is an end-user's decision where the cursor to be added, and it is not a good decision to always interfere with its position. 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Yuriy
Top achievements
Rank 1
Share this question
or