Hi,
I tried looking through the docs and api reference for the Blazor Editor, but I can't seem to find any resizable property like the one found in the ASP.NET Core component here: ASP.NET Core Editor - Api Reference | Telerik UI for ASP.NET Core
I just wanted to check that this feature is not included in the editor for Blazor before I submitted a feature request. I tried to search the requests as well and I didn't see this request listed.
If this feature does not exist, do you know if it is being currently considered for a future release or if there is a workaround?
Thank you,
Frank
I'm adding my vote to be able to resize the editor without having to resort to CSS or javascript trickery.
This seems like basic functionality and frankly I'm surprised it's not here already.
Hi Dimo,
The auto height feature with min/max height in css with the editor in div mode is a good enough work around for now. Thank you for the help.
Hi Frank,
Indeed, there is no open feature request for a resizable Editor. I converted your ticket to a public feature request for your convenience.
I also need to admit that we don't have this feature in our short-term backlog for the next few months. This may change, depending on customer demand (e.g. the number of votes here).
In the meantime, I can suggest the following workarounds:
Editor in Div EditMode
It is possible to set "auto" Height to the Editor, or not set any Height at all. This will make the component expand automatically, depending on its content. You can apply some min/max height restrictions with a Class:
<TelerikEditor EditMode="EditorEditMode.Div" Class="resizable-editor" />
<style>
.resizable-editor {
min-height: 200px;
max-height: 400px;
}
</style>
Editor in Iframe EditMode
In this case, the Editor has a default Height of "250px". The editable area is a separate web document inside an <iframe>. To achieve flexible height in this case, you will need some JavaScript trickery.
Razor
@inject IJSRuntime jsRuntime
<TelerikEditor EditMode="EditorEditMode.Iframe"
Height="auto"
Id="expanding-editor"
ValueChanged="@ResizeEditor" />
@code {
private async Task ResizeEditor(string newValue)
{
await jsRuntime.InvokeAsync<string>("resizeEditor", "#expanding-editor");
}
}
JavaScript
window.resizeEditor = (editorSelector) => {
var iframe = document.querySelector(editorSelector + " iframe");
if (iframe) {
iframe.style.height = "";
iframe.style.height = iframe.contentDocument.documentElement.scrollHeight + "px";
}
}
Regards,
Dimo
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.