Crosshair when ColorPicker not on the active tab

2 posts, 0 answers
  1. Steven
    Steven avatar
    14 posts
    Member since:
    Oct 2012

    Posted 13 May Link to this post

    When the color picker is on a tab that is not active when the page loads the cursor (crosshair) is not in the right location.  The color is correct, the cursor is not.  I tried a few things I saw in this forum, repainting clientside when the tab becomes active, and adding this script to the bottom of the page.  But no luck.  Any Ideas?  Thank you.  Telerik version = 2017.3.913.45

    function OnClientActiveTabChanged()
    {
        $find("<%=colorBackGround.ClientID %>").repaint();
    }
    Telerik.Web.UI.RadColorPicker.prototype._updateHslSliderBackground = function (hsl, isCustomColor)
            {
                var color = this._hslToRgb(hsl.h, hsl.s, 0.5);
                var slider = isCustomColor ? this.get_millionCustomColorsSlider() : this.get_millionColorsSlider();
                if (slider._trackElement)
                {
                    slider._trackElement.style.backgroundColor = this._rgbValuesToHex(color.r, color.g, color.b);
                }
            }

     

  2. Vessy
    Admin
    Vessy avatar
    2301 posts

    Posted 18 May Link to this post

    Hi Steven,

    You can force the colorPicker to update the color of its HSV palette whn the tab is changed, by setting the desired color again in a similar way:

                function onTabSelected(s, e) {
                    var picker = $find("<%=colorBackGround.ClientID %>");
                    picker.set_selectedColor(picker.get_selectedColor());
                }

    Regards,
    Vessy
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top