[CLOSED] Panel context menu problem in Firefox 51.0.1

  1. #1

    [CLOSED] Panel context menu problem in Firefox 51.0.1

    Hi,
    the context menu into a panel is covered by the Firefox menu in Ext.net 3.3
    Open you example with Firefox https://examples3.ext.net/#/Toolbar/Menu/Context_Menu/
    I can not find a workaround.

    Thank you

    Jimmy
    Last edited by fabricio.murta; Feb 20, 2017 at 12:35 PM.
  2. #2
    Hello Jimmy!

    Well, I just opened firefox here, it was reading version 44.0. Then it offered me to upgrade and now reads 45.0. Still working.

    Seems this way (by going to the 'about' dialog) I can upgrade firefox one step after another. So far it is not reproducing the issue in the sample you pointed...
    - 44.0: ok
    - 45.0: ok
    - 47.0.2: ok
    - 51.0.1: broken. I can see it shows both context and Ext.NET menus at once.

    We'll check it out and hopefully come back to you with a way to overcome this issue shortly.
    Last edited by fabricio.murta; Feb 14, 2017 at 10:15 AM.
  3. #3
    Hello again Jimmy!

    Without trying to turn Ext.NET 3 into 4, the best solution I could find thus far was disabling the context menu from the document body, as suggested here: Disable Firefox's silly right click context menu.

    Changing the body tag from the page to:

    <body oncontextmenu="return(false);">
    But this could be rather undesirable as you will disable the context menu from all the viewport.
  4. #4
    Hi Fabricio,
    I need the context menu so I can't disable in body.
    But in Ext.Net 4 works fine and we are migrating.
    Thank you

    Jimmy
  5. #5
    Hello Jimmy!

    Just to clarify: the "trick" above will disable firefox's own context menu still allowing Ext.NET's to work with firefox. So no double-context-menus anymore. I didn't really try with other browsers, but as they are not affected it would be a good idea to apply this only when the client browser was firefox.

    Interesting enough, on FF 51 you'll get an Ext.isFirefox51 variable as true, so you can check for this and, when upgrade comes for FireFox, it will no longer trigger the context menu fixup code -- assuming FireFox fixed the issue from their side, if that's the case.
    Fabrício Murta
    Developer & Support Expert
  6. #6
    Hi Fabricio,
    the following example works fine.
    Thank you

    Jimmy

    <%@ Page Language="C#" %>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
    
        <script>
    
    
            var setColor = function (menu, color) {
                var cmp;
    
    
                if (menu.lastTargetIn(App.Panel1)) {
                    cmp = App.Panel1;
                } else if (menu.lastTargetIn(App.Panel2)) {
                    cmp = App.Panel2;
                }
    
    
                cmp.body.applyStyles(Ext.String.format('background-color:#{0}', color));
            };
    
    
            var onDocReady = function () {
                if (Ext.isFirefox51) 
                    document.body.addEventListener("contextmenu", function (e) { e.preventDefault(); }, false);
            }
    
    
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" >
                <Listeners>
                    <DocumentReady Handler="onDocReady();" />
                </Listeners>
            </ext:ResourceManager>
    
    
            <ext:ColorMenu ID="ColorMenu1" runat="server">
                <Listeners>
                    <Select Handler="setColor(#{ColorMenu1}, color);" />
                </Listeners>
            </ext:ColorMenu>
    
    
            <ext:Panel
                ID="Panel1"
                runat="server"
                Height="200"
                Title="Right-Click on this Panel"
                ContextMenuID="ColorMenu1"
                />
    
    
            <ext:Panel
                ID="Panel2"
                runat="server"
                Height="200"
                Title="Right-Click on this Panel too!"
                ContextMenuID="ColorMenu1"
                />
        </form>
    </body>
    </html>
  7. #7
    Hello! Nice sample! I believe that would be just the same of

    <body oncontextmenu="e.preventDefault();">
    But yes, placing it on the onReady ensures you can do ExtJS-side check for the firefox affected version and avoid the trouble! Thanks for sharing the solution that best worked for you!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] grid panel context menu.
    By Prasoon in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 19, 2015, 12:55 PM
  2. [CLOSED] grid panel context menu items.
    By Prasoon in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 02, 2015, 6:02 AM
  3. [CLOSED] context menu in the tree panel?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 10, 2013, 11:58 AM
  4. [CLOSED] Context Menu in the Tree panel
    By Shanth in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 23, 2011, 2:02 PM
  5. [CLOSED] Tab Panel Context Menu
    By skyone in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 12, 2011, 4:56 PM

Posting Permissions