From 39b2fe45a5639824ce58583227f92fc35ffc4a30 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 20 Jul 2022 11:11:44 +0100 Subject: [PATCH] Ensure all typedInput buttons have button type set Fixes #3780 Otherwise they act as type="submit" and the browser will click on them when enter is pressed in an input --- .../editor-client/src/js/ui/common/typedInput.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 549479d85..ef1be05bc 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 @@ -90,10 +90,10 @@ optEl.append(generateSpans(srcMatch)); optEl.appendTo(element); } - matches.push({ - value: optVal, - label: element, - i: (valMatch.found ? valMatch.index : srcMatch.index) + matches.push({ + value: optVal, + label: element, + i: (valMatch.found ? valMatch.index : srcMatch.index) }); } }) @@ -501,7 +501,7 @@ this.options.types = this.options.types||Object.keys(allOptions); } - this.selectTrigger = $('').prependTo(this.uiSelect); + this.selectTrigger = $('').prependTo(this.uiSelect); $('').toggle(this.options.types.length > 1).appendTo(this.selectTrigger); this.selectLabel = $('').appendTo(this.selectTrigger); @@ -570,7 +570,7 @@ }) // explicitly set optionSelectTrigger display to inline-block otherwise jQ sets it to 'inline' - this.optionSelectTrigger = $('').appendTo(this.uiSelect); + this.optionSelectTrigger = $('').appendTo(this.uiSelect); this.optionSelectLabel = $('').prependTo(this.optionSelectTrigger); // RED.popover.tooltip(this.optionSelectLabel,function() { // return that.optionValue; @@ -591,7 +591,7 @@ that.uiSelect.addClass('red-ui-typedInput-focus'); }); - this.optionExpandButton = $('').appendTo(this.uiSelect); + this.optionExpandButton = $('').appendTo(this.uiSelect); this.optionExpandButtonIcon = $('').appendTo(this.optionExpandButton); this.type(this.typeField.val() || this.options.default||this.typeList[0].value);