This is a migrated thread and some comments may be shown as answers.

Color Picker Hover behavior

1 Answer 80 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 01 Sep 2009, 04:57 AM
I have been playing around with the color picker and I notice a behavior which doesn't seem logical. When hovering over the pallete, the "preview" color is shown as you hover over each option, however, if you stop hovering over the colorpicker, the last hovered-over color is what is shown in the preview, even if this color was not selected (clicked on).  In my opinion, when you move your mouse outside of the area that shows the color pallet, the preview should revert to the currently selected color. If the picker's SelectedColor is not set, then it should display a default ("white" I suppose, or even beter, a box with a line denoting "No Color"). I can't off the top of my head think of any scenario where you would want the preview pane to remember the last color that happened to be hovered over, since, in order for the user to "leave" the pallete, they likely have to hover over colors they don't want to select. Even if there were such a scenario, I would think my example would be a much more natural behavior. Either way, there should be some sort of setting which defines this, and I  couldn't find this. Is there any way to prevent this behavior in the current control?

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 03 Sep 2009, 05:04 PM
Hi Albert Shenker,
I agree with you that this should be the behavior of the RadColorPicker control and I will forward it to our developers. For the time being, the only approach that I can offer you is to attach a handler for the outermost element of the control that will reset the preview element. For example:
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
         
        <script type="text/javascript"
        function OnClientLoaded(sender, args) 
        { 
            $addHandler(sender.get_element(), "mouseout", Function.createDelegate(sender, window.ClearPreview)); 
        } 
         
        function ClearPreview() 
        { 
            this.set_selectedColor(this.get_selectedColor()); 
        } 
        </script> 
         
        <telerik:RadColorPicker ID="RadColorPicker1" runat="server" OnClientLoaded="OnClientLoaded"
        </telerik:RadColorPicker> 
    </form> 
</body> 

I updated your Telerik points for the feature request.

Kind regards,
Tsvetie
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ColorPicker
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Tsvetie
Telerik team
Share this question
or