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

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

3 Answers 94 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Zarko Petrovic
Top achievements
Rank 1
Zarko Petrovic asked on 28 Nov 2018, 09:44 AM

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

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 29 Nov 2018, 08:51 AM
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
0
Zarko Petrovic
Top achievements
Rank 1
answered on 30 Nov 2018, 12:47 PM

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

0
Stefan
Telerik team
answered on 03 Dec 2018, 09:50 AM
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
Tags
Wrappers for React
Asked by
Zarko Petrovic
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Zarko Petrovic
Top achievements
Rank 1
Share this question
or