Last Updated: 26 May 2022 09:01 by Liyuan
Created on: 26 May 2022 09:01
Category: Editor
Type: Bug Report
The context menu closes itself after shown when you call getContextMenuByTagName method

The execution of the getContextMenuByTagName inside the oncontextmenu event of RadEditor hides the context menu once it is shown. This happens in Lightweight render mode only and when the UseRadContextMenu is enabled:

<telerik:RadEditor ID="RadEditor1" runat="server" ContentAreaMode="iframe" OnClientLoad="OnClientLoad">
    function OnClientLoad(editor, args) {
        editor.attachEventHandler("oncontextmenu", function (e) {
            var oSelection = editor.getSelectedElement();

            setTimeout(function () {
                var tdMenu = editor.getContextMenuByTagName("TD"); //the call of getContextMenuByTagName closes the context menu when lightweight render mode is used. You can slow down the closing with the setTimeout function or by settign UseRadContextMenu to false.

            }, 1000);