PDA

View Full Version : Key events disapears in TextArea if used in menu [SOLVED]



badframe
3 May 2010, 11:09 PM
Hi all,

I experiment a strange thing an I need some lights.

I created a panel with a textarea object in it.
Ok, the cursor keys and return key are working as ususal.

I place the panel in the menu (See source) and I now I cannot use arrows/ return key. (but I can edit text as usual).

May I forgot something or is it a bug?

Thanks for your support.

I am working on: ExtJS V3.2 Firefox 3.6.3



var pnl_menu = new Ext.Panel(
{
width:130
,height:100
,layout:'fit'
,items:
{
xtype:'textarea'
}
}
)


var pnl = new Ext.Panel(
{
width:120
,height:100
,layout:'fit'
,items:[
{
xtype:'textarea'
}
]
}
)


tp = Ext.extend(Ext.menu.Menu,
{
enableScrolling : false
,initComponent : function()
{
Ext.apply(this, {
plain: true
,showSeparator: false
,items:
[
{
text: 'simple menu item'
},
pnl_menu
]
})
tp.superclass.initComponent.call(this);
}
}
);


var p = new Ext.Panel(
{
width:500
,height:300
,tbar:[
{
text:'Do not work'
,menu:new tp({})
}
]
,items:[pnl]
}
)

p.render('manager2')
Panel inside of the menu do not act with cursor and return keys

badframe
19 May 2010, 4:06 AM
BUMP

Nobody had this problem before?

Please Help!!!

Condor
19 May 2010, 4:38 AM
These events bubble up from the textarea to the menu and the menu acts on these keys.

You could fix this by disableing menu keyboard handling while the textarea has the focus, e.g.

textarea.on({
focus: function(){
menu.keyNav.disable();
},
blur: function(){
menu.keyNav.enable();
}
});

badframe
19 May 2010, 11:46 PM
Hi Condor,

THANK YOU very much. I added these events and (of course) it works!

I appreciated your help!

best Regards!