-
6 Apr 2012 8:49 AM #1
Input type fields: 'paste' event doesn't work
Input type fields: 'paste' event doesn't work
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.1
- Safari 5.1
- For input-type fields like e.g. Ext.field.Search 'paste' event is never fired.
- Create an Ext.field.Search and subscribe to 'paste' event
- Paste some data into the field by using pasteboard -> 'paste' event is not fired for the created component
Code:Ext.create('Ext.field.Search', { listeners: { 'keyup': function () { console.log('key pressed'); }, 'paste': function () { console.log('paste done'); } } });
HELPFUL INFORMATION
Debugging already done:- My quick investigation shows that this happens because Ext.event.publisher.Dom handledEvents[] doesn't include 'paste' event.
Thank you in advance,
Regards
-
6 Apr 2012 9:07 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Until this gets fixed, here is a quick override to get the paste event working:
Code:Ext.define('Override.field.Input', { override : 'Ext.field.Input', initElement : function() { this.callParent(); this.input.dom.addEventListener('paste', Ext.Function.bind(this.onPaste, this)); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Apr 2012 2:01 AM #3
Thanks a lot. Are you planning to support the 'oncut' event for input fields?
Regards
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2686
in
2.1.


Reply With Quote