diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/properties.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/properties.js index f3a5960e0..cfa72be10 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/properties.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/properties.js @@ -107,7 +107,7 @@ newValue = ""; } } - if (node[d] != newValue) { + if (!isEqual(node[d], newValue)) { if (node._def.defaults[d].type) { // Change to a related config node var configNode = RED.nodes.node(node[d]); @@ -139,6 +139,23 @@ } }); + /** + * Compares `newValue` with `originalValue` for equality. + * @param {*} originalValue Original value + * @param {*} newValue New value + * @returns {boolean} true if originalValue equals newValue, otherwise false + */ + function isEqual(originalValue, newValue) { + try { + if(originalValue == newValue) { + return true; + } + return JSON.stringify(originalValue) === JSON.stringify(newValue); + } catch (err) { + return false; + } + } + /** * Update the node credentials from the edit form * @param node - the node containing the credentials