Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michele Benolli 31 posts 149 karma points
    Sep 06, 2021 @ 10:24
    Michele Benolli
    0

    Umbraco 8 Color Picker issue

    I am not able to use the Umbraco.ColorPicker property editor in Umbraco v8.15.2. When I try to add a new color to the list, a JavaScript exception is thrown: TypeError: elem.spectrum is not a function at setColorPicker.... The color picker is not displayed and the color code cannot be changed. As a result, I can only add the default black #000000 color to the list. The issue seems to be unrelated to the browser.

    enter image description here

  • Bjarne Fyrstenborg 1286 posts 4060 karma points MVP 8x c-trib
    Sep 06, 2021 @ 10:31
    Bjarne Fyrstenborg
    0

    Hi Michele

    Umbraco use the Spectrum color picker plugin. Originally https://bgrins.github.io/spectrum/ but now a newer version https://seballot.github.io/spectrum/ forked from the original project.

    Do you use any other packages, which are including spectrum color plugin, which may collide with the Umbraco core color picker.

  • Michele Benolli 31 posts 149 karma points
    Sep 06, 2021 @ 18:11
    Michele Benolli
    0

    Hi Bjarne, No, I'm working on a clean installation of Umbraco, without any external packages.

  • Bjarne Fyrstenborg 1286 posts 4060 karma points MVP 8x c-trib
    Sep 06, 2021 @ 21:56
    Bjarne Fyrstenborg
    0

    It sounds like Spectrum assets isn't loaded although it should be here: https://github.com/umbraco/Umbraco-CMS/blob/82cf0e30a5ffb1052e5198cbec12f161cf78590a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbcolorpicker.directive.js#L157

    I am currently working on some projects based on v8.15 but haven't noticed this issue.

  • Bjarne Fyrstenborg 1286 posts 4060 karma points MVP 8x c-trib
    Sep 07, 2021 @ 07:12
    Bjarne Fyrstenborg
    0

    I just tried installing a clean Umbraco v8.15.2 with default starterkit.

    But I can't really reproduce the issue.

    enter image description here

    Do you have any custom stuff like dashboard, property editor, etc in App_Plugins folder?

  • Michele Benolli 31 posts 149 karma points
    Sep 16, 2021 @ 07:14
    Michele Benolli
    100

    As you suggested, I tried to remove the content of the App_Plugins folder, custom sections, dashboards, etc. Finally, I found the issue. It was caused by the inclusion of JavaScript files in the Scripts folder (jQuery, Bootstrap...), scripts loaded by Umbraco along the libraries included with the CMS. Once I removed these files, the colorPicker started working correctly. Thanks for your help!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies