Unplanned
Last Updated: 12 Apr 2022 11:41 by ADMIN
Swapnil
Created on: 12 Apr 2022 11:39
Category: FileExplorer
Type: Bug Report
0
Scrolling breaks if the FIleExplorer is palces iniside a container with Absolute/Fixed positioning
If the FileExplorer is located inside a container with position "absolute" or "fixed" the Scrolling mechanism breaks.
1 comment
ADMIN
Attila Antal
Posted on: 12 Apr 2022 11:41

Hi Swapnil,

Thank you for reporting this problem!

Workaround

The workaround would be to override the built-in JS code and use the Browser's JS function to get the dimensions. More specifically the Y positioning.

To be on the safe side, place this code at the bottom of the page, right before the closing Form tag.

You can find the workaround highlighted in blue:

    <script>
        if (Telerik && Telerik.Web && Telerik.Web.UI && Telerik.Web.UI.RadFileExplorer) {
            Telerik.Web.UI.RadFileExplorer.prototype._probeTreeForScrolling = function (domEvent) {
                var scrollDirection = { x: 0, y: 0 };
                var eLoc = $telerik.isTouchDevice ? $telerik.getTouchEventLocation(domEvent) : { x: domEvent.clientX, y: domEvent.clientY };
                var treePane = this.get_treePane();
                var paneBounds = $telerik.getBounds(treePane.getContentElement());

                // Start Custom Fix
                paneBounds.y = Math.ceil(treePane.getContentElement().getBoundingClientRect().y);
                // End Custom Fix

                if (eLoc.y < paneBounds.y + 20)
                    scrollDirection.y = -1;
                else if (eLoc.y > paneBounds.y + paneBounds.height - 20)
                    scrollDirection.y = 1;

                if (eLoc.x < paneBounds.x + 20)
                    scrollDirection.x = -1;
                else if (eLoc.x > paneBounds.x + paneBounds.width - 20)
                    scrollDirection.x = 1;

                return scrollDirection;
            }
        }
    </script>
</form>

 

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.