• The plugin sets a global window.Color variable, breaking the one enqueued by the WordPress color picker (wp-color-picker).

    Please rename your global js Color variable.

Viewing 1 replies (of 1 total)
  • Thread Starter Gemini Labs

    (@geminilabs)

    To reproduce this bug:

    1. Enqueue “wp-color-picker” as a dependency to an enqueued script:

    wp_enqueue_script('plugin-script-handle', $path_to_file, ['jquery', 'wp-color-picker']);
    wp_enqueue_style('wp-color-picker');

    2. In the script, use the color picker like this (assuming there is an input with a “color-picker-hex” class on the page):

    jQuery('input[type=text].color-picker-hex').each((index, el) => jQuery(el).wpColorPicker({
    change: (ev, ui) => jQuery(ev.target).val(ui.color.toString()).trigger('change'),
    mode: 'hsl',
    palettes: false,
    width: 180,
    }));
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.