When the Editor is disabled, the user can still focus it by tabbing and edit the content. The issue occurs in both Div and Iframe EditMode.
Click on the textbox and press TAB:
<input type="text" tabindex="0" />
<TelerikEditor Enabled="false"
EditMode="@EditorEditMode.Div"
Height="200px" />
Hi Patrik,
Thanks, this is a real gotcha and the Editor should not allow it.
I experimented with the component to find a workaround. It seems the only way to avoid editing is to replace the disabled Editor with a <div> that displays the Editor value:
<label> <TelerikCheckBox @bind-Value="@EditorEnabled" /> Enable Editor </label>
@if (EditorEnabled)
{
<TelerikEditor Enabled="@EditorEnabled"
EditMode="@EditorEditMode.Div"
@bind-Value="@EditorValue"
Height="@EditorHeight">
</TelerikEditor>
}
else
{
<div style="height:@EditorHeight" class="k-editor k-state-disabled">
<div class="k-editor-content">
@((MarkupString)EditorValue)
</div>
</div>
}
@code {
string EditorValue { get; set; } = "<p>foo bar baz</p>";
bool EditorEnabled { get; set; } = false;
string EditorHeight { get; set; } = "160px";
}
Regards,
Dimo
Progress Telerik