I have created a custom widget that has two color settings. The color settings are based on this code https://gist.github.com/rodica-andronache/54f3ea95bcaf76435e55
The color pickers work fine, however, only after the customizer is saved and the page is reloaded. If you click on the color field straight after adding it to the panel, nothing happens.
Any help would be much appreciated. Thanks.