kendo-editor-react-wrapper BR and TABLE tags problem

4 posts, 0 answers
  1. Zarko Petrovic
    Zarko Petrovic avatar
    8 posts
    Member since:
    Apr 2010

    Posted 28 Nov 2018 Link to this post

    Hi,

    I have problem with Editor component when HTML that is edited has a combination of <br/> and <table> tags. 

    When user places cursor on <br/> tag and hits Enter few times (for new line) cursor is always returning to the begining of the document.

    This is the StackBlitz where problem can be reproduced:

    https://stackblitz.com/edit/react-xybam8-kendo-editor-kbx7fx

    and this is the video showing the problem:

    https://vimeo.com/303234790

     

    Thanks,

    Zarko

  2. Stefan
    Admin
    Stefan avatar
    2909 posts

    Posted 29 Nov 2018 Link to this post

    Hello, Zarko,

    Thank you for the details and the example.

    After inspecting I noticed that this occurs because of the spaces between the <br/> and the text.

    After removing them, it is working as expected:

    https://stackblitz.com/edit/react-xybam8-kendo-editor-rhfeka?file=data/text2.html

    If the spaces are required based on the application logic, please provide more details on the use case and we will investigate further.

    Regards,
    Stefan
    Progress 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. Zarko Petrovic
    Zarko Petrovic avatar
    8 posts
    Member since:
    Apr 2010

    Posted 30 Nov 2018 in reply to Stefan Link to this post

    You are right, that fixed the problem.

    I will try to use regex before populating Editor to fix spaces after <br/> tags, but users can paste any html they like in this control and I cannot control all of that, so this should be fixed since <br/> tag with spaces or new lines after it still valid HTML.

     

    Thanks,

    Zarko

  4. Stefan
    Admin
    Stefan avatar
    2909 posts

    Posted 03 Dec 2018 Link to this post

    Hello, Zarko,

    I agree that the user can paste an HTML like this one.

    I can suggest using the paste event to strip the pasted HTML from more than one <br/> elements in a row:

    https://docs.telerik.com/kendo-ui/api/javascript/ui/editor/events/paste

    Also, please have in mind that we are already working on a native Editor.

    Regards,
    Stefan
    Progress 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