Appointment is invalid and Cannot Read Property errors for Scheduler in Chrome 61

1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1696 posts
    Member since:
    Oct 2004

    Posted 18 Oct Link to this post

    The new Chrome 61 introduces some breaking changes which may lead to some of the following errors when the browser is scrolled and the resize handler of an appointment is clicked:

    • Uncaught TypeError: Cannot read property ‘viewPartIndex’ of null

    • Sys.WebForms.PageRequestManagerServerErrorException: Appointment Start time must be before the End time

    • Uncaught TypeError: Cannot read property 'cells' of undefined

    • Uncaught TypeError: Cannot read property 'resizeFromStart' of null

    • Uncaught TypeError: Cannot read property 'intervalIndex' of null;


    Solution:

    Placing the following JavaScript override before the declaration of the Scheduler should resolve all of the above issues: 

    <script type="text/javascript">
        Telerik.Web.UI.RadScheduler.prototype._compensateScrollOffset = function (contentTable) {
            //In Chrome and Safari document.documentElement.scrollTop is always 0, due to a browser bug
            var scrollingElement = document.body.scrollTop <= document.scrollingElement.scrollTop ? document.scrollingElement : document.body;
            var bodyOffsetElement = $telerik.isSafari || $telerik.isChrome ? scrollingElement : document.documentElement,
                bodyScrollOffset = $telerik.getScrollOffset(bodyOffsetElement, false),
                scrollOffset = $telerik.getScrollOffset(contentTable, true);
     
            scrollOffset.x -= bodyScrollOffset.x;
            scrollOffset.y -= bodyScrollOffset.y;
     
            contentTable.targetRect.x += scrollOffset.x;
            contentTable.targetRect.y += scrollOffset.y;
     
            // The Safari issue here could be a problem in getLocation (used in getBounds). This code offsets it
            //if($telerik.isSafari3 || $telerik.isSafari4 || $telerik.isChrome)
            //{
            //    contentTable.targetRect.x += scrollOffset.x;
            //    contentTable.targetRect.y += scrollOffset.y;
            //}
        }
    </script>
    <telerik:RadScheduler runat="server" ID="RadScheduler1" ... >

    If any other issues are observed in Chrome 61+ environment, please share them along with more details and specific examples of the reproduction steps so we can update the information here. 

    For more information on the Google Chrome update and any issues with the position of ToolTips and ContextMenus, you may refer to http://www.telerik.com/forums/wrong-placement-of-radcontextmenu-in-chrome-61

Back to Top