Unplanned
Last Updated: 13 Dec 2024 13:43 by ADMIN
Stephan
Created on: 09 Dec 2024 06:46
Category: Editor
Type: Bug Report
1
Telerik Editor wrong color format

Hello,

the Color Tool Customization in the Telerik Editor is not working correctly. Colors are only generate HTML in Rgb.

The documentation says: "ValueFormat":  The format, which the Color tool will set in the generated HTML markup. Use Rgb or Hex.

Thanks in advance.

 

For example: https://docs.telerik.com/blazor-ui/components/editor/built-in-tools#color-tool-customization

@using Telerik.Blazor.Components.Editor

<TelerikEditor Tools="@EditorTools"
               @bind-Value="@EditorValue">
</TelerikEditor>

@code {
    private string EditorValue { get; set; }

    private List<IEditorTool> EditorTools { get; set; } = new List<IEditorTool>()
    {
        new ForeColor()
        {
            Title = "Text Color",
            Colors = new List<string> { "#f00", "#ff9900", "rgb(0, 128, 0)", "rgba(0, 0, 255, .8)" },
            ValueFormat = ColorFormat.Hex
        },
        new ViewHtml()
    };
}

 

1 comment
ADMIN
Tsvetomir
Posted on: 13 Dec 2024 13:43

Hello Stephan, 

After testing the provided example, I can confirm that the behavior is a bug in the Editor. With that in mind, I'm changing the bug report status to "Unplanned".

You are automatically subscribed as a creator, which means you will receive email notifications regarding the status updates of this item. Also, as a token of appreciation, I have credited your account with Telerik points for reporting first this bug. Please excuse us for any trouble caused.

In the meantime, a possible alternative is to replace the built-in ColorPickers with custom tools that look the same way. Set a Hex ValueFormat and a ValueTemplate, which copies the HTML markup of the default ColorPicker tools. Here is a REPL example of the approach.

Regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.