Project: titanium
Issue TIMOB-13364: Android: TextArea maxLength not working in Android
According to the docs, TextArea supports maxLength property from SDK 3.0. However, maxLength does not work in Android. In TiUIText.java, the code that reads the maxLength is: if (d.containsKey(TiC.PROPERTY_MAX_LENGTH) && field) { maxLength = TiConvert.toInt(d, TiC.PROPERTY_MAX_LENGTH); } TextArea has "field" boolean set to false, so maxLength is always ignored. Steps to reproduce. Create simple App.js: {code} var win = Ti.UI.createWindow({ backgroundColor: 'white' }); var textArea = Ti.UI.createTextArea({ borderWidth: 2, borderColor: '#bbb', borderRadius: 5, color: '#888', textAlign: 'left', maxLength: 10, top: 60, width: 300, height : 150 }); win.add(textArea); win.open(); {code} Launch app and start writing in the text area. You can enter more than 10 chars, despite maxLength is set to 10. Tested with SDK 3.0.0.GA in Android 2.3.3 and Android 4.1
Story points: 3