mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Fix node validation if property is not required
This commit is contained in:
		| @@ -148,12 +148,23 @@ RED.editor = (function() { | ||||
|             ((typeof definition[property].label) == "string")) { | ||||
|             label = definition[property].label; | ||||
|         } | ||||
|         if ("required" in definition[property] && definition[property].required) { | ||||
|             valid = value !== ""; | ||||
|             if (!valid && label) { | ||||
|                 return RED._("validator.errors.missing-required-prop", { | ||||
|                     prop: label | ||||
|                 }); | ||||
|         if ("required" in definition[property]) { | ||||
|             if (definition[property].required) { | ||||
|                 valid = value !== ""; | ||||
|                 if (!valid && label) { | ||||
|                     return RED._("validator.errors.missing-required-prop", { | ||||
|                         prop: label | ||||
|                     }); | ||||
|                 } | ||||
|             } else { | ||||
|                 if (value === "") { | ||||
|                     return true; | ||||
|                 } | ||||
|             } | ||||
|              | ||||
|         } else { | ||||
|             if (value === "") { | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|         if (valid && "validate" in definition[property]) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user