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

All content are selected and getting script error when back from HTML mode to Design mode in Editor

5 Answers 21 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amrut
Top achievements
Rank 1
Amrut asked on 23 Jul 2015, 11:47 AM

Hello,
I have come across a problem with the editor.

We have recently upgraded the telerik controls from V 2013 to V 2015.2.623.45. 

After upgrade new version that some functionality are messed up.​

Steps to reproduce the issue.

1 - Add below content HTML mode.

<html>
    <head>
    </head>
    <body contenteditable="true">
        T<span style="color: #00b050;">esting New Message twetw&nbsp;</span><span style="color: #00b050; background-color: #c4bd97;">werwrwerwrwrwrwrwrwrwrw<sup>rwerwrww<sub>rwrwrwrwrwr</sub></sup><sub>rwerwrewrwr</sub></span>
        <p style="text-align: left;"><a name="Hello" href="http://www.bing.com" class="body">Hello</a><br />
        <br />
        </p>
        <img src="https://www.google.co.in/images/srpr/logo11w.png" alt="bb" style="display: block; width: 78px; height: 116px; border: 9px solid #ff0000;" height="116px" width="78px" />
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p style="text-align: left;">&nbsp;</p>
        <p>&nbsp;</p>
        <p><img alt="" src="https://www.google.co.in/images/srpr/logo11w.png" style="height: 74px; width: 371px;" height="100px" width="100px" /><br />
        <br />
        <br />
        </p>
    </body>
</html>​

2 - Back to Design mode and set focus on Image

3 - Then go to HTML mode and back to Design mode. 

4 - All content are selected on Design mode in Editor.

 When move 3-4 time from Design to Html mode then getting script error "Uncaught TypeError: Cannot use 'in' operator to search for 'fontFamily' in undefined" as well.

This can easily be reproduced on your demo site as well(Chrome browser).

refer below link and find attached the image file for script error

http://screencast.com/t/Lb5FLNiBW5TZ

please give a quick reply with solution as this is blocker part of development.
Thanks.

5 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 28 Jul 2015, 07:28 AM
Hi Amrut,

Thank you for reporting this issue.

It is indeed a bug and I have logged it in our database for fixing. You can monitor the status via this feedback portal item—http://feedback.telerik.com/Project/108/Feedback/Details/164932.

As appreciation for the report, I have updated your Telerik points.

For the time being you can use a custom client-side function that ensures that there is always selected text in the editor:
<telerik:RadEditor runat="server" ID="RadEdior1" OnClientSelectionChange="OnClientSelectionChange">
</telerik:RadEditor>
 
<script type="text/javascript">
    function OnClientSelectionChange(editor, args) {
        if (!editor.getSelectedElement()) {
            editor.focusFirstText();
        }
    }
</script>


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
Amrut
Top achievements
Rank 1
answered on 29 Jul 2015, 01:50 PM

Thanks Ianko for your reply, This solution works fine. "editor.focusFirstText()" function  is set focus on first line of editor content which is fine but after that when i click enter key then nothing happen.I checked that enter key click event is fire but cursor in stick on first line.

Steps to reproduce the issue.

1 - In editor NewLineMode="Br".

2 - Add below content HTML mode.

<html><head> </head><body>test<br><br>test<br><br>test<br><br>test<br><br>test</body></html>

3 - Back to Design mode(Cursor is set on first line).Press enter key 

Result : Cursor in stick instead of add <br> tag.

In above scenario Enter key works fine when press any other key before enter key.

Please suggest. 

Thanks.​

0
Ianko
Telerik team
answered on 30 Jul 2015, 05:17 AM
Hi Amrut,

I tried to reproduce the described behavior, but to no avail. You can see the results on my end via this screencast—http://screencast.com/t/fvzmpYXX.

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
Amrut
Top achievements
Rank 1
answered on 31 Jul 2015, 05:01 AM

Thanks Ianko for your reply.

As per your video when you move from HTML mode to design mode and again open HTML mode, That all <br> tags are closed as <br/>  but in my case it always <br> which is default behavior of current Telerik verison.

So might be this is the cause of issue. 

 

Please suggest that how we fix this. 

Thanks.​

0
Ianko
Telerik team
answered on 31 Jul 2015, 06:53 AM
Hi,

Check whether there is some configuration change regarding Content Filters. I suggest trying using the DefaultFilters option, or at least enable the ConvertToXhtml filter—RadEditor1.EnableFilter(EditorFilters.ConvertToXhtml).

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
General Discussions
Asked by
Amrut
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Amrut
Top achievements
Rank 1
Share this question
or