I'm trying to apply a CSS class to the <p> tag using the "Apply CSS Class".
In the latest version of Chrome the RADEditor adds a new <span> tag around text instead than adding the CSS class to the <p> tag.
Example: <p><span class="someClass">Text</span></p>
The Firefox correctly handles applying a CSS class to an element selected via the DOM Inspector.
Example: <p class="someClass">Text</p>
Best regards,
Andrey
4 Answers, 1 is accepted
The Apply Css Class tool is designed to work only with a text selection, i.e., to add the class, text should be selected. If selection does not exist and empty span with the class is inserted.
Additionally, this command (among with some other) entirely relies on native browser commands, and the final HTML result from this is controlled by the browser. Due to that the exact behavior cannot be controlled by the RadEditor, and thus cannot be changed.
On a side note, testing with this demo on my end the results are the opposite to the ones described. Under Firefox, on element selected a span is added, but in Chrome the p tag gets with class name.
Optionally, as a custom solution, you can alter the behavior of this command with the use of custom JavaScript logic handled in the OnClientCommandExecuting event.
Regards,
Ianko
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi,
In the latest version of RadEditor, in chrome
While using the bullet lists,
When I add a couple of bullets and tab for the third one, it still persists with the top level list and does not create a sub list.
This feature works fine in IE. and firefox does not support tabs at all.
Steps to reproduce,
1. Select bullet list
2. Add a couple of rows.
3. press tab on the third row.
Expectation:
Should create a sub list.
Result:
Creates a span of white space.
PFA the image.
The editor to the left is IE and the one to the right is chrome.
If you see the html section.
IE generates a sub li element . But Chrome generates a span on tab
Karthik
Hey,
Is there a fix for this, or a workaround.
Karthik
You can check out the solution showcased here—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/accessibility-and-internationalization/keyboard-support/tab-key-behavior
<
telerik:RadEditor
runat
=
"server"
OnClientLoad
=
"OnClientLoad"
/>
<
script
>
function OnClientLoad(editor, args) {
var shortcutManager = editor.get_shortCutManager();
if (shortcutManager.findShortCutByName("InsertTabMozilla")) {
shortcutManager.removeShortCut("InsertTabMozilla");
editor.addShortCut("InsertTab", "TAB");
}
}
</
script
>
Regards,
Ianko
Telerik