-
25 Jan 2013 1:43 AM #1
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',
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
modal: true,
value: 'q',
fn: function(btn, newName) {
if (btn == 'ok') {
if (newName.length > 3){
alert('ERROR');
}
}
}
});
-
Best Answer Posted by Romick
Seems that there is a bug in 'Ext.form.field.TextArea'
PHP Code:isCutCopyPasteSelectAll: function(e, key) {
if (e.CTRL) {//But should be e.ctrlKey which is boolean
return key === e.A || key === e.C || key === e.V || key === e.X;
}
return false;
}
-
25 Jan 2013 1:54 AM #2
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(e, key) {
if (e.CTRL) {//But should be e.ctrlKey which is boolean
return key === e.A || key === e.C || key === e.V || key === e.X;
}
return false;
}
-
7 Feb 2013 3:07 PM #3
Bug?
Bug?
Can anyone confirm this issue or it just me?
-
7 Feb 2013 3:53 PM #4Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,087
- Vote Rating
- 97
- Answers
- 169
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!
-
26 Mar 2013 4:52 AM #5
Could you please post fix here. I see in ext-4.2.0.663 this work. But I need this for 4.1.3
-
26 Mar 2013 6:21 AM #6
4.1.3 override
4.1.3 override
It should be as simple as this (credit to Romick for the solution above):
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.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; } });
-
26 Mar 2013 6:58 AM #7


Reply With Quote