From 7955a17a17e05a643dc4013b9c224e5070f20ac8 Mon Sep 17 00:00:00 2001 From: Mauricio Bonani Date: Wed, 4 May 2022 06:37:52 -0400 Subject: [PATCH] Fix typedInput label not visible --- .../editor-client/src/js/ui/common/typedInput.js | 5 +---- .../editor-client/src/sass/ui/common/typedInput.scss | 10 ++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) 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 aa05ad695..549479d85 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 @@ -1026,10 +1026,7 @@ $(opt.icon).prependTo(this.selectLabel); } else if (opt.icon.indexOf("/") !== -1) { - image = new Image(); - image.name = opt.icon; - image.src = mapDeprecatedIcon(opt.icon); - $('',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); + $('',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+"); margin-right: 4px;height: 18px;width:13px"}).prependTo(this.selectLabel); } else { $('',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel); 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 da53e1e2d..76345e980 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 @@ -153,6 +153,16 @@ button.red-ui-typedInput-option-trigger img { max-width: none; } + .red-ui-typedInput-icon:not(.fa) { + display: inline-block; + -webkit-mask-size: cover; + mask-size: cover; + -webkit-mask-position: center; + mask-position: center; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + background-color: $primary-text-color; + } } &:not(.disabled):hover {