# Plotly.js: temporarily disable plotly-events

**URL:** <https://community.plotly.com/t/plotly-js-temporarily-disable-plotly-events/71641>\
**Category:** plotly.js\
**Tags:** question\
**Created:** [January 14, 2023, 9:02pm UTC](https://community.plotly.com/t/plotly-js-temporarily-disable-plotly-events/71641 "2023-01-14T21:02:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonvdrdo](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jonvdrdo](https://community.plotly.com/u/jonvdrdo)\
**Post date:** [January 14, 2023, 9:02pm UTC](https://community.plotly.com/t/plotly-js-temporarily-disable-plotly-events/71641/1 "2023-01-14T21:02:33Z")

</div>

Hi,

Is there any convenient way to temporarily disable a `plotly.on` event?

Use-case:

I have a dash app which listens to `relayout` events; however, in a certain part of a custom component, I perform `Plotly.relayout` to trigger a layout update of the graph, but I do not want that this triggers a `relayout` event.

Example use case 👇

```javascript
// I tried the once, method, but this didn't do anything
graphDiv._ev.once('plotly_relayout', () => { });
console.log('Relayout should not trigger `relayoutevent`');
Plotly.relayout(graphDiv, head(updateData));

```

Any help would be greatly appreciated,  
Kind regards,  
Jonas

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 17, 2023, 9:56pm UTC](https://community.plotly.com/t/plotly-js-temporarily-disable-plotly-events/71641/2 "2023-01-17T21:56:26Z")

</div>

Hello @jonvdrdo,

I dont know if there is a way to do this, I have tried event.stopPropogation before.

You could unbind events, but not sure if that would work.
