Search code examples
htmlknockout.jscolor-picker

KnockoutJS and HTML5 input color


I have an HTML table and a foreach binding for tbody td.

Every td has html binding that use a function to generate different html element.

In one case, html element generated is a

<input type"color" />

but after creation, if I click on the input box, the color picker is not showed.

I think there is something wrong about knockoutjs context...isn't true?

Here a JSFIDDLE

Thank you


Solution

  • Your click-binding was preventing it from working. Return true in the callback fixes it:

    self.fieldTypeHandler = function(row, prop){
        return true;
    };