Last Updated: 04 Dec 2017 09:54 by Anatoliy
Created on: 21 Sep 2017 12:12
Category: UI for ASP.NET AJAX
Type: Bug Report
Wrong placement (position) of RadContextMenu in Chrome 61

With the latest version of Chrome 61 the context menu is not positioning correctly in the treeview. It only happens when the treeview is longer than the window height and there are scrollbars. The EnableScreenBoundaryDetection should be enabled too (it is enabled by default).

Reproduction: see this video for a repro The problem does not happen in the Chrome versions prior 61.

Details and Resolution: 

The context menu positioning problem is due to the following breaking change in Chrome 61 (see release notes at

To align with the spec and preserve browser consistency, the scrollingElement is now the documentElement in standards mode.
Chrome 61 has changed the behavior of document.scrollingElement to return document.documentElement instead of document.body to match the CSSOM View specification and this broke the positioning of the context menu when the EnableScreenBoundaryDetection is enabled.

Solution 1
Place the following override over the RadTreeView declaration:

Telerik.Web.UI.RadMenu._getViewPortSize = function () {
        var viewPortSize = $telerik.getViewPortSize();
        // The document scroll is not included in the viewport size
        // calculation under FF/quirks and Edge.     
        var quirksMode = document.compatMode != "CSS1Compat";
        if (($telerik.isFirefox && quirksMode) || Telerik.Web.Browser.edge) {
            viewPortSize.height += document.body.scrollTop;
            viewPortSize.width += document.body.scrollLeft;
        else if ( {
            viewPortSize.height += Math.max(document.body.scrollTop, document.scrollingElement.scrollTop);
            viewPortSize.width += Math.max(document.body.scrollLeft, document.scrollingElement.scrollLeft);
        return viewPortSize;
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView2" runat="server">
        <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenu1"runat="server"  RenderMode="Lightweight">

Solution 2
Set EnableScreenBoundaryDetection to false. This will disable the screen boundary detection and some parts of the context menu could be rendered beneath the browser borders when there isn't enough space to be rendered on the visible screen. You will have to use the browser scrollbars to show the hidden part of the menu.

The issue is scheduled for fixing in R3 2017 SP1, the release date of which is not yet decided. Please use the provided solutions above until the SP1 goes out officially.
Posted on: 04 Dec 2017 09:54
Sorry, Opera still have troubles!
Posted on: 04 Dec 2017 09:27
How to use first solution for RadSchedule contextmenu?

Case: ReferenceError: Telerik is not defined
Find solution at
Posted on: 26 Sep 2017 18:24
I had to change the if( to if( && (document.scrollingElement !== document.body)), otherwise the context menu was not correctly placed in chrome versions prior to 61.