How to work around Kendo UI ColorPicker validation bug for HEX colors?

416 Views Asked by At

The Kendo UI color picker control allows entering HEX value manually.

But is has a bug: if you try to enter #123XXX, you will see then #112233

The reason is the Kendo UI color picker parses the first part of the color #123 (which is a correct short form) and ignores the rest XXX symbols (which are not valid HEX symbols)

If you try another case: enter #XXX123, you will see the validation error (HEX value will be highlighted with red).

I need to validate correctly both cases and show the validation error. But I can not find a way to add custom validation to this control.

Question: do you know how to work around this bug and make Kendo UI color picker control fail on validating values like #123XXX, #ADCXYZ, #19BW00 instead of cutting off the last 3 symbols and interpret the first 3 as a short HEX form?

0

There are 0 best solutions below