RadEditor adds two p tags after pressing Enter

4 posts, 0 answers
  1. Yuriy
    Yuriy avatar
    4 posts
    Member since:
    Mar 2012

    Posted 13 Oct 2015 Link to this post

    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.

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 14 Oct 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Yuriy
    Yuriy avatar
    4 posts
    Member since:
    Mar 2012

    Posted 14 Oct 2015 in reply to Ianko Link to this post

    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

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 15 Oct 2015 Link to this post

    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
Back to Top