# How disable propertie name of task?

**URL:** <https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971>\
**Category:** Developers\
**Created:** [May 2, 2024, 1:10pm UTC](https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971 "2024-05-02T13:10:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgod](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/l/b77776/32.png) [@lgod](https://forum.bpmn.io/u/lgod)\
**Post date:** [May 2, 2024, 1:10pm UTC](https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971/1 "2024-05-02T13:10:09Z")

</div>

I need to disable the name field of the tasks, when I drag the component from the palette to the diagram, it opens in editing mode to enter the value of the name field, I don’t want this behavior, with double click I managed to solve it, it is possible to do the same by drag and drop into the diagram? Which event should I use?

```auto
 var priority = 10000;
    eventBus.on('element.dblclick', priority, function (event) {
      const { element } = event;
      if (isAny(element, ['bpmn:Task'])) {
        return false;
      }
    });
    eventBus.on('element.changed', priority, function (event) {
      const { element } = event;
      if (isAny(element, ['bpmn:Task'])) {
        return false; 
      }
    })

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [May 2, 2024, 2:57pm UTC](https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971/2 "2024-05-02T14:57:30Z")

</div>

Why would you want to disable name editing on bpmn?

Generally speaking, the best way to disable a feature in bpmn-js is to override it using dependency injection. Label editing is defined here:

> <https://github.com/bpmn-io/bpmn-js/blob/d3449ca87c32366fe0be4b10c2c01a48360aaa08/lib/features/label-editing/index.js#L9-L21>

So you module could do

```auto
export const DisableLabelEditingProvider = {
  labelEditingProvider: ["value", null],
  labelEditingPreview: ["value", null],
};

```

[https://codesandbox.io/p/sandbox/modest-tu-qrhgmm?file=%2Fsrc%2FCustomLabelEditing.js%3A1%2C1-5%2C1](https://codesandbox.io/p/sandbox/modest-tu-qrhgmm?file=%2Fsrc%2FCustomLabelEditing.js%3A1%2C1-5%2C1)

---

<div class="post-metadata">

**Author:** ![lgod](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/l/b77776/32.png) [@lgod](https://forum.bpmn.io/u/lgod)\
**Post date:** [May 2, 2024, 5:06pm UTC](https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971/3 "2024-05-02T17:06:08Z")

</div>

Perfect, that’s what I needed, thank you very much.

---

<div class="post-metadata">

**Author:** ![system](https://forum.bpmn.io/uploads/default/original/2X/b/b534893973385c2d302b38572464112e4adae002.png) [@system](https://forum.bpmn.io/u/system)\
**Post date:** [May 9, 2024, 5:06pm UTC](https://forum.bpmn.io/t/how-disable-propertie-name-of-task/10971/4 "2024-05-09T17:06:24Z")

</div>

Closed on May 9, 2024, 5:06pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
