View Full Version : [CLOSED] Pasting into a combobox with [SHIFT]+[INS] does not fire triggers

6 Sep 2010, 3:41 AM
One of our users has spotted that pasting into a combobox filters and shows the combo options when using [CTRL]+[V], but not the lesser-known alternative [SHIFT]+[INS]. You can see this on the EXT sample pages:


Is there a techincal reason for this, or can this be tweaked in a future release so they both behave the same? In my mind the two key combinations are equivalent, so should have the same behavior.

6 Sep 2010, 4:22 AM
The problem is that most browsers don't fire any event for this (you can also paste using the mouse right-click context menu).

You could add extra listeners for cut and paste, but they would only work on IE and Webkit and not on Firefox and Opera.

6 Sep 2010, 5:30 AM
Thanks Condor. I will take a look at events - I guess a paste listener would be the only way to catch both of them. As it happens, only working in IE and Webkit is OK for us as we recommending those to our users (and not having this isn't exactly a show-stopper).

I've had a further dig around the forums and found this, so I'll give it a try:


6 Sep 2010, 5:43 AM

var _initEvents = Ext.form.ComboBox.prototype.initEvents;
Ext.override(Ext.form.ComboBox, {
initEvents: function(){
cut: this.onCutPaste,
paste: this.onCutPaste,
scope: this
onCutPaste: function(){
delete this.lastKey;
(disclaimer: untested code)

7 Sep 2010, 6:15 AM
Bingo...that's solved it

I've tested on a PC - it works well on IE8, Chrome and Firefox (a nice surprise). So it's only not working in Opera & IE7 but that's fine in my case.

Thanks for your help Condor