1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default Answered: TextArea enforceMaxLength and maxLength not working in IE with key ("x", "c", "v")

    Answered: TextArea enforceMaxLength and maxLength not working in IE with key ("x", "c", "v")


    Hi!
    I have a problem. In IE I when set textArea.maxLength = 3, but I can enter more than 3 key such as ("x", "c", "v") is it a bug? Below is my test case:
    PHP Code:
       Ext.MessageBox.textArea.enforceMaxLength true;
        
    Ext.MessageBox.textArea.maxLength 3;
        
    Ext.MessageBox.show({
            
    title'enforceMaxLength and maxLength Not Work in IE with key ("x", "c", "v") you can input as much as you want!',
            
    msg'Please enter 3 letter word',
            
    buttonsExt.MessageBox.OKCANCEL,
            
    multilinetrue,
            
    modaltrue,
            
    value'q',
            
    fn: function(btnnewName) {
              if (
    btn == 'ok') {
                if (
    newName.length 3){
                  
    alert('ERROR');
                }
              }
            }
        }); 

  2. Seems that there is a bug in 'Ext.form.field.TextArea'

    PHP Code:
     isCutCopyPasteSelectAll: function(ekey) {        
      if (
    e.CTRL) {//But should be e.ctrlKey which is boolean
         
    return key === e.|| key === e.|| key === e.|| key === e.X;
       }
       return 
    false;


  3. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default Can be this a problem ?

    Can be this a problem ?


    Seems that there is a bug in 'Ext.form.field.TextArea'

    PHP Code:
     isCutCopyPasteSelectAll: function(ekey) {        
      if (
    e.CTRL) {//But should be e.ctrlKey which is boolean
         
    return key === e.|| key === e.|| key === e.|| key === e.X;
       }
       return 
    false;


  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default Bug?

    Bug?


    Can anyone confirm this issue or it just me?

  5. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,661
    Answers
    434
    Vote Rating
    584
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Yes, looks like a bug, we'll get it fixed up.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    16
    Vote Rating
    0
    rchernyshenko is on a distinguished road

      0  

    Default


    Could you please post fix here. I see in ext-4.2.0.663 this work. But I need this for 4.1.3

  7. #6
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    72
    Answers
    6
    Vote Rating
    13
    eric.cook will become famous soon enough

      0  

    Default 4.1.3 override

    4.1.3 override


    It should be as simple as this (credit to Romick for the solution above):

    Code:
    Ext.override(Ext.form.field.TextArea, {
        isCutCopyPasteSelectAll: function(e, key) {
            if (e.ctrlKey) {
                return key === e.A || key === e.C || key === e.V || key === e.X;
            }
            return false;
        }
    });
    Key events are a touchy subject and getting a fully cross-browser and cross-platform solution is not easy. But this at least should be what the original code intended.

  8. #7
    Sencha User
    Join Date
    Jan 2013
    Posts
    16
    Vote Rating
    0
    rchernyshenko is on a distinguished road

      0  

    Default


    Thank you