mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Don't use the typedInput tooltip to get the validation message
This commit is contained in:
parent
6aae50294f
commit
34ed9c5cd8
@ -1543,7 +1543,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
validate: function() {
|
||||
validate: function(options) {
|
||||
let valid = true;
|
||||
const value = this.value();
|
||||
const type = this.type();
|
||||
@ -1580,7 +1580,10 @@
|
||||
tooltip.delete();
|
||||
}
|
||||
}
|
||||
// Must return a boolean
|
||||
if (options.returnErrorMessage === true) {
|
||||
return valid;
|
||||
}
|
||||
// Must return a boolean for no 3.x validator
|
||||
return (typeof valid === "string") ? false : valid;
|
||||
},
|
||||
show: function() {
|
||||
|
@ -190,14 +190,9 @@ RED.editor = (function() {
|
||||
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 === false) {
|
||||
// Try to find validation message in the tooltip
|
||||
const tooltip = input.data("tooltip");
|
||||
if (tooltip) {
|
||||
const content = tooltip.getContent();
|
||||
valid = label ? label + ": " + content : content;
|
||||
}
|
||||
valid = input.typedInput("validate", { returnErrorMessage: true });
|
||||
if (typeof valid === "string") {
|
||||
valid = label ? label + ": " + valid : valid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user