New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Context menus do not work on iPads after latest iOS update 13

Environment

Product RadContextMenu for ASP.NET AJAX
Operating System iOS 13+
Browser Safari

Description

After the recent update to iOS 13, iPads are not able to Tap & Hold to access the right click context menu, for example the AppointmentContextMenu on the RadScheduler. Also, on the server, Request.Browser.IsMobileDevice call that is part of ASP.NET now returns false for iPad devices.

The issue is replicated only in Safari browsers on iPad devices with iOS 13.

The following simple HTML also replicates the issues where the text selection is triggered before the contextmenu event:

<div id="test" style="height:100px; background-color:green; border:1px solid red"></div>
<script>
    $(document).ready(function () {
        $("#test").on("contextmenu", function () {
            alert(3);
        })
    });
</script>

Cause

This is a common issue and is related to the experimental PinterEvents feature of iOS:

The reason behind this behavior is the intention of Apple to promote iPad tablets as desktop/stationary devices. That means the "Request Desktop Site" is enabled by default for all websites in iPads with iOS 13+, which will send a UserAgent string the same as on a Mac machine.

Suggested Workarounds

The good thing is that at the moment of writing, there are no MAC machines with built-in touch screens, so the navigator.maxTouchPoints. This means placing the following script on the page will solve the issue:

// iPad with enabled "Request Desktop Site" 
if ($telerik.isTouchDevice == false && navigator.maxTouchPoints > 0 && Telerik.Web.Platform.mac) {
    $telerik.isTouchDevice = true;
    Telerik.Web.Platform.ipad = true;
    Telerik.Web.Platform.mac = false;
}
In this article
Not finding the help you need? Improve this article