[4.2.0] Ext.suspendLayouts causes a menu to be not rendered

An Ext.suspendLayouts call causes a menu to be not rendered. Please follow the test case.

Initially, suspending layouts is used to improve performance of the TreePanel to reduce the delay on node expanding. It is used with ExtJS 4.1, because it doesn't support buffered rendering for trees yet. But it somehow causes a context menu to be not rendered on some scenario (see the steps to reproduce). And it is reproducible with 4.2, so, I am reporting it. Maybe, it breaks the normal event flow, that is why it causing the problem, but there is, potentially, a problem with layouting.

Steps to reproduce the problem:

Click the Load button

Right click on the node

The result that was expected:

The context menu appears.

It does appears if do either:

Right click the node before clicking the Load button

Or remove suspendLayouts/resumeLayouts calls

Or replace them with, respectively, "this.suspendLayout = true;" and "this.suspendLayout = false; this.doLayout();" for the tree

One of the less obvious interactions between layouts and components is that layouts are where rendering takes place for new children. Though perhaps there are better ways to do this, this has historically been the case.

The practical effect of this in 4.1+ is that suspendLayouts then prevents this rendering by preventing (rather delaying) the layout. This is precisely why we were unable to auto-batch layouts. Changing this interaction would have profound effect on timing of events that would probably produce an enormous regression for people - my early Ext JS apps would often have logic in afterrender or afterlayout somewhat at random and it "just worked".

I'm afraid this is one we cannot "fix" because the fix would require fully decoupling rendering from layout and that would be a next-generation kind of thing.