OnImageRemoving not triggered

Hi,

I'm using SfRichTextEditor on a Server Side Blazor App.

Clicking trash button on Insert Image Dialog Box don't trigger OnImageRemoving event.
When click on this button, the Blazor App display a message "Attempting to reconnect to the server" and an error appears on browser and 

[2021-04-07T16:18:32.613Z] Error: Connection disconnected with error 'Error: Server returned an error on close: Connection closed with an error.'.
e.log @ blazor.server.js:1

The event is then trigger when user click on Cancel button; the handler receive parameters args.Cancel=false and args.FilesData=null.

If it is a bug, waiting for a fix, it is possible to hide the trash button?

Thanks  

6 Replies 1 reply marked as answer

RK Revanth Krishnan Syncfusion Team April 8, 2021 08:43 AM UTC

Hi Lorella, 
 
 
Greetings from Syncfusion support. 
 
 
We have validated your query “OnImageRemoving event not triggering after the delete icon in the insert image dialog and throws ‘Connection disconnected with error 'Error: Server returned an error on close: Connection closed with an error.' And the event is triggered when clicking on the cancel button”. 
 
We tried to reproduce the issue in the following ways, 
  • Uploading and then clicking the delete icon with SaveUrl and Path property configured.
  • Uploading and then clicking the delete icon without SaveUrl and Path property.
  • Ensured the issue in all browsers.
 
But we couldn’t reproduce the issue from our end. The event is triggered properly with proper arguments. We have prepared a sample for your reference, 
 
Can you please share us with more following details, 
  • The code snippet of the Rich Text Editor rendered in the application.
  • The exact package version used in the application.
  • If possible please share us with the issue reproducible sample or please modify the shared sample with the issue reproducing steps.
 
The above details will be helpful for us to validate and reproduce the issue from our end and assist you at the earliest. 
 
Regards, 
Revanth 



LC Lorella Caglio April 8, 2021 10:59 AM UTC

Hi,
In my application SfRichTextEditor is used inside a custom component that inherits from InputBase<string>.
I modified the sample solution to reproduce the issue (view attach file).

MyComponent.razor:

@inherits InputBase<string>
@using Syncfusion.Blazor.RichTextEditor

<SfRichTextEditor @bind-Value="@CurrentValue">
    <RichTextEditorImageSettings SaveUrl="api/Image/Save" Path="./Images/"></RichTextEditorImageSettings>
    <RichTextEditorEvents OnImageRemoving="@imageRemovingEventHandler"></RichTextEditorEvents>
</SfRichTextEditor>

@code {
    public void imageRemovingEventHandler(Syncfusion.Blazor.Inputs.RemovingEventArgs args)
    {
        var a = args;
    }

    protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage)
    {
        result = value;
        validationErrorMessage = null;
        return true;
    }

Index.razor:

@page "/"
@if (EditContext == null)
{
    <h3>Loading ...</h3>
}
else
{
    <EditForm EditContext="@EditContext">
        <div class="card-body">
            <div class="form-row">
                <MyComponent @bind-Value="@Model.HtmlText"></MyComponent>
            </div>
        </div>
    </EditForm>
}

@code {
    private SampleModel Model { get; set; } = new SampleModel();
    private EditContext EditContext { get; set; }

    protected override void OnInitialized()
    {
        // real app loads model from db in OnInitializedAsync()

        Model = new SampleModel();
        EditContext = new EditContext(Model);
    }

    public class SampleModel
    {
        public string HtmlText { get; set; }
    }
}


Attachment: SfRichTextEditor_SampleApp_9b3f946a.zip


RK Revanth Krishnan Syncfusion Team April 9, 2021 11:30 AM UTC

Hi Lorella, 
 
 
Good day to you. 
 
 
We have further validated your query with the shared sample and we can reproduce the issue from our end and this issue occurred because the Rich Text Editor is rendered inside the ‘EditForm’. We have considered “'OnImageRemoving' event not triggered when rendering the Rich Text Editor inside 'EditForm'” as a bug from our end and logged the report for the same and the fix will be included in our patch release on 21st  April.    
    
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/24107 
 
Regards, 
Revanth 



RK Revanth Krishnan Syncfusion Team April 19, 2021 12:24 PM UTC

Hi Lorella, 
 
 
Thanks for the patience. 
 
 
We have further validated your query, and the issue occurred because, by default, the server-side blazor SignalR maximum message size is 32KB. This is a limitation of the server-side blazor. Please find the server-side blazor SignalR documentation. 
 
 
The reported issue can be resolved by increasing the buffer size. We have prepared a sample for your reference, 
 
Code Snippet: 
Startup.cs 
 
public void ConfigureServices(IServiceCollection services) 
{ 
    . . . 
    . . . 
    services.AddSignalR(p => { 
        p.MaximumReceiveMessageSize = 102400000; 
    }); 
} 
 
 
Please check the above code snippet and the sample and let us know if it resolves the issue. 
 
Regards, 
Revanth 


Marked as answer

LC Lorella Caglio April 20, 2021 07:20 AM UTC

Hi Revanth,

this resolve the issue.

Thanks



RK Revanth Krishnan Syncfusion Team April 21, 2021 03:20 AM UTC

Hi Lorella, 
 
Thanks for the update. 
 
We are glad that the reported issue has been resolved. Please let us know if you need further assistance. 
 
Regards, 
Revanth 


Loader.
Up arrow icon