Colour Picker

Documentation

WordPress ships with default colour picker Iris which have issues of colour auto-fill. So to fix that issue we have to remove onkeyup listener.

1.Create a javascript file and add below code.

(function ($) {
    $('.sui-colorpicker-input').keyup(function(){
        $(this).off('keyup');
    });
})(jQuery);    

2.Include javascript file in plugin this code will add that script file at the end of page after iris.js. It is important to call script the end of page then it will override the default onkeyup function.

function my_scripts() {
    wp_register_script('my-script', plugin_dir_url( __FILE__ ) . 'SCRIPT.JS','','1.1', true);
    wp_enqueue_script('my-script');
}
add_action( 'admin_enqueue_scripts', 'my_scripts' );