Hi
This works:
<RichTextEditorToolbarSettings Items="RTE_TOOLBAR_ITEMS" />
...
static readonly List<ToolbarItemModel> RTE_TOOLBAR_ITEMS = new()
{
...
new ToolbarItemModel() { Command = ToolbarCommand.Undo },
new ToolbarItemModel() { Command = ToolbarCommand.Redo }
}
But this does not work:
<RichTextEditorToolbarSettings Items="RTE_TOOLBAR_ITEMS" />
...
static readonly List<ToolbarItemModel> RTE_TOOLBAR_ITEMS = new()
{
...
new ToolbarItemModel() { Command = ToolbarCommand.Undo }
}
Blazor throws the following error in the browser console:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at Syncfusion.Blazor.Navigations.SfToolbar.EnableItems(List`1 items, Nullable`1 isEnable)
at Syncfusion.Blazor.RichTextEditor.Internal.Toolbar.EnableItems(List`1 itemData, Boolean enable)
at Syncfusion.Blazor.RichTextEditor.Internal.Toolbar.Created()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeEvent[T](Object eventFn, T eventArgs)
at Syncfusion.Blazor.Navigations.SfToolbar.OnAfterScriptRendered()
at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)
at Syncfusion.Blazor.Navigations.SfToolbar.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Hope you can fix it!