diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index fa1e68cca..332f41fa9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -965,6 +965,18 @@ }, hide: function() { this.uiSelect.hide(); + }, + 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"); } }); })(jQuery); diff --git a/packages/node_modules/@node-red/editor-client/src/sass/ui/common/typedInput.scss b/packages/node_modules/@node-red/editor-client/src/sass/ui/common/typedInput.scss index fb3e331ee..14cb3f70e 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/ui/common/typedInput.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/ui/common/typedInput.scss @@ -26,6 +26,14 @@ box-sizing: border-box; overflow:visible; position: relative; + &[disabled] { + input, button { + background: $secondary-background-inactive; + pointer-events: none; + cursor: not-allowed; + } + } + .red-ui-typedInput-input-wrap { flex-grow: 1; }