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

background color bug

1 Answer 99 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jason Rodman
Top achievements
Rank 1
Jason Rodman asked on 16 Sep 2008, 02:15 AM
I use a custom stylesheet for the body of the editor to set the font and background colors. Here is what the css looks like:

body

{
font-family: Arial, Helvetica, san-serif; font-size: 11px;
background-color: #383838;
color: #fff;
}

But something wierd happens when using the editor. If I start typing in the editor without changing anything, the text looks just fine. But if I select the text i have entered, hit backspace to delete and type some more, the editor wraps that text in a <span> tag and applies a different background color to that text. Here is the markup the editor creates:

<span style="background-color: #383838">this is a test</span>

Normally this would be fine, but it just so happens that the page I am putting the output of the editor on does not always have the same background color so the text looks highlighted. Is there any way to prevent it from putting a background color unless specifically added via the text background tool?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Sep 2008, 12:16 PM
Hi Jason,

Thank you for reporting this problem.

We were able to reproduce it and found that it appears only when the selection starts from the top left position of the content area and it appears sporadically. You can see our test in the attached video here.

At first glance the problems looks like a browser bug which appears only in IE when the background color is applied to the body tag. The problem is not reproducible in Firefox.

We are not sure whether this browser behavior can be fixed and it will be very hard but we logged the problem in our bug tracking system for further research. Currently, you can try to disable the editor's client filter and see whether the problem still persists on your side: RadEditor1.ContentFilters = EditorFilters.None.

You can also strip the SPAN tags on submit with the solution provided in this help article: Cleaning Word Formatting On Page Load And On Submit. You should supply a SPAN as a value of the FormatStripper tool, e.g.

editor.fire("FormatStripper", {value : "SPAN"});

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Jason Rodman
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or