Fix validateNodeProperty if no validator provided

This commit is contained in:
GogoVega 2023-11-28 20:13:25 +01:00
parent 6ec052be18
commit a2d7772958
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -182,6 +182,17 @@ RED.editor = (function() {
error: err.message
});
}
} else if (valid) {
// 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";
const prefix = isConfig ? "node-config-input" : "node-input";
const input = $("#"+prefix+"-"+property);
const isTypedInput = input.length > 0 && input.next(".red-ui-typedInput-container").length > 0;
if (isTypedInput) {
valid = input.typedInput("validate");
}
}
}
if (valid && definition[property].type && RED.nodes.getType(definition[property].type) && !("validate" in definition[property])) {
if (!value || value == "_ADD_") {