mirror of
https://github.com/node-red/node-red
synced 2024-11-21 23:48:30 +00:00
Merge pull request #4812 from GogoVega/fix-required-prop
Fix node validation if the property is not required
This commit is contained in:
commit
da787a9993
@ -157,6 +157,12 @@ RED.editor = (function() {
|
||||
}
|
||||
}
|
||||
if (valid && "validate" in definition[property]) {
|
||||
if (definition[property].hasOwnProperty("required") &&
|
||||
definition[property].required === false) {
|
||||
if (value === "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
var opt = {};
|
||||
if (label) {
|
||||
@ -183,6 +189,11 @@ RED.editor = (function() {
|
||||
});
|
||||
}
|
||||
} else if (valid) {
|
||||
if (definition[property].hasOwnProperty("required") && definition[property].required === false) {
|
||||
if (value === "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If the validator is not provided in node property => Check if the input has a validator
|
||||
if ("category" in node._def) {
|
||||
const isConfig = node._def.category === "config";
|
||||
|
Loading…
Reference in New Issue
Block a user