PDA

View Full Version : [CLOSED-563] contextmenu and e.stopEvent under FF 3.6 on Intel Mac



dantheman
12 Feb 2010, 8:27 AM
Ext version tested:

Ext 3.1.1


Adapter used:

ext


css used:

only default ext-all.css




Browser versions tested against:
Doesn't Work:

FF 3.6 (firebug 1.5.0 installed)

Works:

Safari 4.0.4
Chrome beta (5.0.307.7)
IE7 (WINE-bottler package on Mac)


Operating System:

Mac Leopard 10.5.8


Description:

I wish to handle the contextmenu event, and prevent the browser from showing its context menu. My handler works, but the browser still shows its menu.


Test Case:



<html><head>
<link rel="stylesheet" href="/ext-3.1.1/resources/css/ext-all.css" />

<script src="/ext-3.1.1/adapter/ext/ext-base.js"></script>
<script src="/ext-3.1.1/ext-all-debug.js"></script>

<script>
Ext.onReady(function(){

Ext.BLANK_IMAGE_URL = '/ext-3.1.1/resources/images/default/s.gif';
Ext.QuickTips.init();

var tree = new Ext.tree.TreePanel({
renderTo: 'tree-panel',
root: new Ext.tree.TreeNode({
id: 'tree-root',
expanded: true,
text: 'da root'
}),
listeners: {
// this was a suggestion in the Help forum discussion (see link below)
render: function() {
Ext.getBody().on("contextmenu", Ext.emptyFn, null, {stopEvent: true});
},
contextmenu: function(node, e) {
e.stopEvent(); // also tried e.preventDefault() to no avail
alert("node: "+node.text);
}
}
});

tree.getRootNode().appendChild([{
id: 'child-one',
text: 'First Child'
},{
id: 'child-two',
text: 'Second Child'
},{
id: 'child-three',
text: 'Third Child'
}]);

});
</script>
</head><body><div id="tree-panel"></div></body></html>


See this URL : from the Help forum: https://www.extjs.com/forum/showthread.php?t=91676


Steps to reproduce the problem:

Right-click on a tree node. Alert will tell you the node's text, and FF will show its context menu


The result that was expected:

FF would NOT show its context menu


The result that occurs instead:

FF does show its context menu


Screenshot or Video:

NONE


Debugging already done:

NONE


Possible fix:

??

evant
14 Feb 2010, 7:56 PM
Can't confirm this using FF3.6 on Windows XP. Anyone else?

mystix
14 Feb 2010, 8:42 PM
Can't reproduce it on an Intel Mac (OSX 10.6.2), running Fx3.6.

dantheman
15 Feb 2010, 4:43 PM
I had my wife check the test page (on a MBP) and it works properly!

So I set about repeating my original debugging steps of disabling all my add-ons
and plugins .. nothing worked.

I finally poked around in her preferences, specifically the advanced menu for javascript (under Content).
There is a checkbox item to allow scripts to Disable or replace context menus".

As far as I recall, I've never even seen this menu, but my setting was not checked,
and FF was apparently following this preference, by insisting on showing the context menu.

I haven't adjusted my preferences in years.
It never occurred to me that such a preference even existed.

Please accept my sincere apologies for the wasted time.
--dan

Jamie Avins
15 Feb 2010, 5:03 PM
No problem, never know when someone else will have the same issue.

dantheman
15 Feb 2010, 7:15 PM
No problem, never know when someone else will have the same issue. :D You're very gracious. Thanks.

mystix
15 Feb 2010, 10:20 PM
I finally poked around in her preferences, specifically the advanced menu for javascript (under Content).
There is a checkbox item to allow scripts to Disable or replace context menus".


wow, thanks for the heads up on that!

never knew that option existed too. guess it's yet one more thing to look out for in future.

dantheman
16 Feb 2010, 9:39 AM
wow, thanks for the heads up on that!

never knew that option existed too. guess it's yet one more thing to look out for in future.It was a real WTF moment for me ..

jay@moduscreate.com
9 Mar 2010, 6:15 PM
It seems that Fx 3.6, by default, must now have this enabled. I have a new MacBook Pro and Fx 3.6 is the only version of the browser installed and a fresh profile to boot and I had this problem.

I knew it wasn't an Ext JS specific problem because I tested it on in 2.x, where I knew things were working. Ugh!