mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4455 from GogoVega/4429-fix-validateNodeProperty
Fix `validateNodeProperty` without validator provided
This commit is contained in:
commit
3e2d20e536
@ -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_") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user