RadEditor not honoring the font size for <li>

1 Answer 77 Views
Editor
Sanjay
Top achievements
Rank 1
Sanjay asked on 06 Apr 2022, 07:51 AM
Hello Support team,

We are facing some issues while adding list items in RadEditor, if the default size is changed it changes the size of the text in the list item but it does not change the size of the numbers representing each list item.
can you please check the attached screenshot?

Please look into it and let us know if you need any other information.

Thanks & Regards

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 06 Apr 2022, 08:33 AM

Hi Sanjay,

This is the default browser behavior of the document.execCommand("FontSize") command to update only the ordered lists text without the shape (glyphs). This behavior can be observed in the following video I recorded for you  http://youtu.be/JfJdmNq-OKg?hd=1 as well as in the competitors' HTML editors too.

The demo demonstrated in the video can be found at http://dojo.telerik.com/@nlazarov/IFIPAR.  

If you want to fine-tune the Fonts or RealFontSizes commands of RadEditor so that the font-size is applied to the list itself you can use the JS based solution provided in the following forum thread on the matter:

Rad Editor - Numbered Bullet list is not changing Size

 

<script type="text/javascript">
    function OnClientCommandExecuting(editor, args) {
        //The command name
        var commandName = args.get_commandName();
 
        if (commandName == "RealFontSize" || commandName == "FontSize") {
            var selElem = editor.getSelectedElement(); //get the selected element
 
            var parentElem = selElem.parentNode;
 
            if (selElem.tagName == "LI" || selElem.tagName == "UL" || selElem.tagName == "OL") {
                if ($telerik.isIE7 || $telerik.isIE8) {
                    selElem.parentNode.style.fontSize = args.get_value();
                }
                else selElem.style.fontSize = args.get_value();
            }
            args.set_cancel(true);
        }
    }
</script>
<telerik:RadEditor ID="RadEditor1" OnClientCommandExecuting="OnClientCommandExecuting" runat="server">
    <Content>
        <ol>
            <li>dasdd</li>
            <li>dasdas</li>
            <li>dasasd</li>
        </ol>
    </Content>
</telerik:RadEditor>

Best Regards,
Rumen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Editor
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or