# Readonly TypedInput

**URL:** <https://discourse.nodered.org/t/readonly-typedinput/35358>\
**Category:** Developing Nodes\
**Created:** [5 November 2020 08:03 UTC](https://discourse.nodered.org/t/readonly-typedinput/35358 "2020-11-05T08:03:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 November 2020 21:45 UTC](https://discourse.nodered.org/t/readonly-typedinput/35358/4 "2020-11-05T21:45:51Z")

</div>

If you were gonna do it in core, I 'd suggest adding CSS to set these based on the `disabled` attribute.

e.g...

 ![KdPSADpopD](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21e3b2b45e82b7e89cfce63820b1b79282c4fee2.gif)

Add to `typedInput`...

```auto
        disable: function(val) {
            if(val === true) {
                this.uiSelect.attr("disabled", "disabled");
            } else if (val === false) {
                this.uiSelect.attr("disabled", null); //remove attr
            } else {
                this.uiSelect.attr("disabled", val); //user value
            }
        },
        disabled: function() {
            return this.uiSelect.attr("disabled");
        }

```

below the hide function  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/754df9569ffc1073c95a99de2a07592bc8a2b155.png)

and the scss to disable the buttons and inputs in `typedInput.scss`...

```css
    &[disabled] {
        input, button {
            background: $secondary-background-inactive;
            pointer-events: none;
            cursor: not-allowed;
        }
    }

```

at line 28...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58788138d6a518f78cebfa0d447ea671863c6a80.png)

* * *

but get the OK from Nick or Dave before raising PR

---

_[View the full topic](https://discourse.nodered.org/t/readonly-typedinput/35358)._
