Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2686 in 2.1.
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    24
    Vote Rating
    2
    natb is on a distinguished road

      0  

    Default 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
    Browser versions tested against:
    • Safari 5.1
    Description:
    • For input-type fields like e.g. Ext.field.Search 'paste' event is never fired.
    Steps to reproduce the problem:
    • 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
    Test Case:
    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.
    BTW: It also would be good to have a 'cut' event supported.

    Thank you in advance,
    Regards

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    24
    Vote Rating
    2
    natb is on a distinguished road

      0  

    Default


    Thanks a lot. Are you planning to support the 'oncut' event for input fields?

    Regards