I did a bit of digging around on the forum and it seems to be a common issue, that the red highlighting is applied to a hidden object.
I tried (unsuccessfully) to target the button border
Failing that I vaguely remember reading that it is possible to pass some options to the validator function so that - invalid input pattern can be replaced by something more helpful ?
I cannot find anywhere now, so I may have dream it
I'm not aware of a common issue here. Can you raise an issue on github? The color picker should highlight errors properly - that's for us to fix.
It is not possible to customise the messages returned by the validator - but you could wrap it with your own code to do so. Something like... (untested, but I think should do it...):
validate: (function () {
const validateFunction = RED.validators.regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/);
return function (v, opt) {
const result = validateFunction(v,opt);
if (typeof result === 'string') {
return 'my custom error message'
}
return result
}
})()
Perhaps common is a bit strong but there were a few along similar lines -
As you probably noticed I'm working a souped-up version of your annotate node.
As there is the possibility to directly type a hex value into the colour picker, I though it best to validate this. However although it marks an error on the node, the input element that gets the error class is a hidden object.
The code you shared should be a least a help to know which picker has the incorrect value, thanks.