# RED.tabs - Request to add a method for disabling/enabling tabs

**URL:** <https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265>\
**Category:** Feature Requests\
**Created:** [15 October 2021 12:07 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265 "2021-10-15T12:07:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 October 2021 12:07 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265/1 "2021-10-15T12:07:32Z")

</div>

Enabling and disabling tabs is really rather more difficult than it should be. Is there any chance of adding these as methods to `RED.tabs`?

As Steve pointed out in [the other thread](https://discourse.nodered.org/t/red-tabs-any-way-to-disable-some-tabs), a tab can be disabled/enabled using CSS `pointer-events`. That doesn't disable all of the contents of course, only being able to access them. But I think that is generally enough.

To disable:

```auto
$(`#red-ui-tab-${tab.id}`).css('pointer-events', 'none')
$(`#red-ui-tab-${tab.id} > a`).css('color', 'var(--nr-db-disabled-text)')

```

and enable with:

```auto
$(`#red-ui-tab-${tab.id}`).css('pointer-events', 'auto')
$(`#red-ui-tab-${tab.id} > a`).css('color', 'var(--nr-db-dark-text)')

```

So not terribly difficult to do - once you've discovered the trick! But it took me far too long to get there.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 October 2021 15:37 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265/2 "2021-10-15T15:37:09Z")

</div>

Hi Julian,  
I use a similar workaround in some of my nodes. Would indeed be nice if it was available as a function.  
Because I always forget in which nodes I have used it, to be able to copy my code snippet. But now at least I can find it here 😉  
Thanks for sharing it!  
Bart

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 October 2021 15:46 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265/3 "2021-10-15T15:46:07Z")

</div>

Makes sense to me.

Happy to review a PR, otherwise I'll try take a look before the 2.1 release.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 October 2021 19:05 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265/4 "2021-10-15T19:05:54Z")

</div>

Bit too deep into restructuring some deep and knarly bits of uibuilder just now but if I get some time, I'll have a go.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 December 2021 19:06 UTC](https://discourse.nodered.org/t/red-tabs-request-to-add-a-method-for-disabling-enabling-tabs/52265/5 "2021-12-14T19:06:18Z")

</div>

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