How can i disable editable text after dragging task element in canvas

I have code for disabling double click event which preventing to show text field.

var priority = 10000;

function DisableContentEditable(eventBus) {

    eventBus.on('element.dblclick', priority, function (context) {
        var element = context.element;
        if(element.type == 'bpmn:Task' || element.type == "bpmn:StartEvent" || element.type == "bpmn:IntermediateThrowEvent" || element.type == "bpmn:EndEvent" || element.type == "bpmn:ExclusiveGateway" || element.type == "bpmn:DataObjectReference" || element.type == "bpmn:DataStoreReference"){
            return false;
        }
    });
}

but while dragging task element.dblclick event is not applied and its editable. but after dragging and clicking anywhere in canvas the element.dblclick event is applied. but i want to disable after dragging as well.

if have any solution will be helpful.

Thanks.

Could you share a CodeSandbox that reproduces your issue in a way that we can inspect it?

That’s correct, the element.dblclick event is not fired after dragging, but one another which activates the direct editing.