PDA

View Full Version : Shadow Pool pull bug in IE [1.1beta]



aconran
15 Jun 2007, 11:45 AM
I am creating a context menu on a JsonView and encountering a problem when shadows are turned on and I show the context menu.

When I disable the shadow (add shadow: false, on the menu) this problem goes away.



contextMenu = new Ext.menu.Menu({
// shadow: false,
id:'context-menu',
items: [{
text: 'Sample A',
scope:this,
handler: this.menuClick
},{
text: 'Sample B',
scope:this,
handler: this.menuClick
},'-',{
text:'Sample C',
scope:this,
handler: this.menuClick
}]
});
e.stopEvent();
contextMenu.showAt(e.getXY()); // <---- breaks here when shadows are on



The callstack in IE line numbers are for ext-all-debug.js Ext 1.1 beta....
line 245: "var range = el.ownerDocument.createRange();" in Ext.DomHelper.inserHtml
- line 12157: "sh = Ext.get((Ext.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup));" in Ext.Shadow.Pool.pull
-- line 12083: "this.el = Ext.Shadow.Pool.pull()" in Ext.Shadow.show's prototype
--- line 11712: "sw.show(this)" in Layer.sync
---- line 11874: "this.sync(true)" in
----- line 3160: "this.setVisible(true, this.preanim(arguments, 0);" in Element.show
------ line 19784: "this.el.show()" in Menu.showAt


I am running ext-base with 1.1beta.

I found this very old thread which seems to be related to the same issue.
http://extjs.com/forum/showthread.php?p=17236#post17236

If it would help I could post an example of the bug somewhere online.

Thanks,
Aaron

aconran
25 Jun 2007, 5:18 AM
As discovered in another thread and by speaking with Jack, IE has a problem with a textnode being the 1st element in the body tag. The solution was to wrap a span around the textnode.

Example:


<body>
Filter by User:
...rest of markup


changed to:


<body>
<span>Filter by User:</span>
...rest of markup

mystix
25 Jun 2007, 5:32 AM
automatically appending an empty <span></span> immediately after the opening <body> tag should work too.