PDA

View Full Version : TextArea focus proplem



blackcat
26 Nov 2010, 7:26 AM
I use Ext.form.TextArea and Ext.form.ComboBox. User input text on textarea, and then can select some text from combobox to insert on textarea. How can I set cursor on textarea after 'select' event fires in combobox? (I try use focus() method, but it doesn't work, cursor is in combobox)

Condor
26 Nov 2010, 7:44 AM
You have to defer the focus on the textarea, because the combobox will refocus itself after the select event, e.g.

combobox.on('select', function(){
textarea.focus();
...
}, combobox, {delay: 1});