We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

RichTextEditor not triggering event ActionComplete when has text

I'm using a rich text editor where the user can paste images, and delete, as you can see:



I use the event ActionComplete to save and delete data from Azure blob storage, with the code bellow:

function actionComplete(args) {
    if (args.requestType == "Image") {
        imgelement = args.elements[0];
        toAzure(imgelement.src, function (dataUrl) {
            imgelement.setAttribute('src', dataUrl)
        })
    }
    if (args.requestType == "Remove") {
        var fileUrl = args.event.itemCollection.selectNode[0].src;
        var nameContainerIndex = "ticketattachment/";
        var indexFile = args.event.itemCollection.selectNode[0].src.indexOf(nameContainerIndex);
        var indexEnd = args.event.itemCollection.selectNode[0].src.indexOf("?");
        var fileName = fileUrl.substr(indexFile + nameContainerIndex.length, indexEnd - indexFile - nameContainerIndex.length);
        deleteBlobIfExists("ticketattachment", fileName); 
    }
}
function toAzure(url, callback) {
    var httpRequest = new XMLHttpRequest();
    httpRequest.onload = function () {
        if (this.status == 200) {
            var fileName = $("#Ticket_Id").val() + "/" + "image" + Math.floor(Math.random() * 1000) + ".png";
            createBlockBlobFromBrowserFile(new File([this.response], fileName), callback);
        }
    };
    httpRequest.open('GET', url);
    httpRequest.responseType = 'blob';
    httpRequest.send();
}


The events are working properly in most of situations, but when it has text and a image bellow, just like:


If i delete the image without clicking on the image the event ActionComplete doesn't trigger, like selecting the text and deleting it all, the event just doesn't trigger.

I tried to use Change event, but this doesn't trigger too.

My editor:


           @Html.EJS().RichTextEditorFor(model =>           model.Ticket.Description).ActionComplete("actionComplete").Change("actionComplete").Blur("validateButtonSubmit").Change("validateButtonSubmit").QuickT          oolbarSettings(e => { e.Image((object)ViewBag.image); }).ToolbarSettings(e => e.Items((object)ViewBag.tools)).Locale("root").Render()


1 Reply

PO Prince Oliver Syncfusion Team June 20, 2019 11:07 AM UTC

Hi Werner,  
 
Greetings from Syncfusion support. 
 
We have validated the issue “Action complete event is not triggered when remove content with text and images” in our end. We are considering this as a defect. The fix for the issue will be included in our upcoming Volume 2, 2019 main release which is expected to be rolled out in the month of July 2019. Meanwhile you can track the status of the issue through the following feedback portal link and contact us for any further queries  
 
Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon