We're using 17.3.0.18. I don't know if this has been fixed in a later version, but I'm finding that when I load up a rich text editor for the first time, it doesn't always display the string that I assign to it's Value parameter. There's a dropdown list above the editor, and it only renders "@TranslationText" when I fiddle with that dropdown, which is not how it should work.
Relevant snippets:
<EjsRichTextEditor @ref="RteObj" Value="@TranslationText">
<RichTextEditorToolbarSettings Type="ToolbarType.MultiRow" EnableFloating="false"
Items="@(new[] {"Undo", "Redo", "|",
"Bold", "Italic", "Underline", "StrikeThrough","|",
"FontName", "FontSize", "FontColor", "BackgroundColor", "|",
"LowerCase", "UpperCase", "SubScript", "SuperScript", "|",
"Formats", "Alignments", "OrderedList", "UnorderedList", "Outdent", "Indent", "|",
"CreateLink", "Image", "|",
"ClearFormat", "Print", "SourceCode", "FullScreen"})">
</RichTextEditorToolbarSettings>
</EjsRichTextEditor>
@code {
[Parameter]
public long MessageId { get; set; }
[Parameter]
public int LanguageId { get; set; }
List<LanguageReadModel> SelectableLanguages { get; set; } = new List<LanguageReadModel>();
MessageTranslationReadModel CurrentTranslation { get; set; } = new MessageTranslationReadModel();
EjsRichTextEditor RteObj;
int? SelectedLanguage;
string TranslationText = "";
bool SaveDialogVisible = false;
ButtonModel OkBtn = new ButtonModel { Content = "Love that", IsPrimary = true };
protected override async Task OnInitializedAsync()
{
var translation = await MessageService.GetSingleTranslationAsync(MessageId, LanguageId);
if (translation.IsSuccess)
{
CurrentTranslation = translation.Result;
TranslationText = translation.Result.TranslatedMessageText;
}
var langRes = await MessageService.GetLanguagesWithoutATranslationAsync(MessageId, LanguageId);
if (langRes.IsSuccess)
{
SelectableLanguages = langRes.Result.ToList();
SelectedLanguage = LanguageId;
//SelectableLanguages.Add(new LanguageReadModel { LanguageId = 100, Name = "A Language" });
//SelectableLanguages = SelectableLanguages.OrderBy(l => l.LanguageId).ToList();
}
}
}
I tried to use the RefreshUI method on the editor, but that didn't work AND it threw an exception in the web console: "TypeError: Cannot read property '0' of undefined"