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

Problem with KeepInScreenBounds

3 Answers 167 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 29 Jan 2016, 07:31 AM

Hi,

When the colorpicker is located at the bottom of a page, it always cuts off the tabs at the bottom.

Se attached image from your demo!

http://demos.telerik.com/aspnet-ajax/colorpicker/examples/overview/defaultcs.aspx

Set "With a picker button" in the demo!

Regard
Andreas

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 02 Feb 2016, 05:31 PM
Hi Andreas,

Indeed, it appears that the height of the popup element of RadColorPicker is not calculated correctly for its Lightweight rendering. As a result, the tabs of the palettes are not fully visible when KeepInScreenBounds is set to true.

I have logged the bug, although I cannot provide a firm estimation when an official fix will be available. You can use the linked bug item to track the status of the issue, vote for it and comment it: http://feedback.telerik.com/Project/108/Feedback/Details/181750. It also includes a workaround you can try until the issue is fixed.

I have updated your Telerik points as a small token of gratitude for reporting the issue at hand.

Regards,
Slav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 03 Feb 2016, 06:41 AM

Thanks!

Well this works in most cases, but we still have an issue when we reset the keepInScreenBounds with client script.
We do this since we have a div that is scrolling outside the ColorPicker and we need to re-position the ColorPicker when scrolling (when the popup is visible)!

From what I can see in the source javascript, there is an error in the RadColorPicker.set_keepInScreenBounds, if setting this to true when the popup is visible it does the following:

var popupBehavior = this._popupBehavior;
if (popupBehavior)
{
    popupBehavior.set_keepInScreenBounds(value);
 
    //If the popup is visible, re-show it.
    if (this._showIcon && this._paletteDisplayed)
        popupBehavior.show();
}

This code will hide the tabs completely since this only measures the height without the tabs!

When the popup is displayed from the color-button it does the following to take care of keepInScreenBounds:

if(this.get_keepInScreenBounds())
{
    this._paletteWrapperElement._originalHeight = this._paletteWrapperElement.style.height;
    this._paletteWrapperElement.style.height = this.getPaletteHeight() + "px";
}
popupBehavior.set_x(0);
popupBehavior.set_y($telerik.getSize(this._iconWrapperElement).height + yCorrectionToGetLocation);
popupBehavior.show();
 
if(this.get_keepInScreenBounds())
{
    this._paletteWrapperElement.style.height = this._paletteWrapperElement._originalHeight;
    this._paletteWrapperElement._originalHeight = null;
}

Should't this code also be called in the set_keepInScreenBounds function?

Regard
Andreas

0
Accepted
Slav
Telerik team
answered on 05 Feb 2016, 04:44 PM
Hello Andreas,

The purpose of the set_keepInScreenBounds client-side method is to be called when you need to change the value of the KeepInScreenBounds property on the client. Nevertheless, you are correct that since the method is designed to update the position of the popup when the value of the property is updated, it should move the whole RadColorPicker in the visible area.

I have logged a new bug  item for this issue: http://feedback.telerik.com/Project/108/Feedback/Details/182087

As for your scenario, there are two methods of the client-side API of RadColorPicker that you can use to update the position of the popup: showPalette and hidePalette. You can prepare a method, similar to the following one and call it each time you need to update the position of the popup palette:
function getColorPicker() {
    return $find("<%=ColorPicker1.ClientID %>");
}
 
function resetPopup() {
    var colorPicker = getColorPicker();
    colorPicker.hidePalette();
    colorPicker.showPalette();
}

I have updated your Telerik points again for reporting the second issue.

Regards,
Slav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ColorPicker
Asked by
Andreas
Top achievements
Rank 1
Answers by
Slav
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or