[TIMOB-10222] iOS: Implement maxLength for TextArea
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-07T14:30:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2012-16 API, Release 3.0.0 |
Components | iOS |
Labels | api, module_textarea, parity, qe-review, qe-testadded |
Reporter | Hieu Pham |
Assignee | Vishal Duggal |
Created | 2012-07-27T15:23:34.000+0000 |
Updated | 2014-06-19T12:43:55.000+0000 |
Description
1. Run this code
var win = Ti.UI.createWindow();
var txt = Ti.UI.createTextArea({
top: 150,
height: 100,
backgroundColor: "white"
});
var button = Ti.UI.createButton( {
title: "set max length to 10"
});
button.addEventListener('click', function(e) {
txt.maxLength = 10;
});
Ti.API.info("maxLength: " + txt.maxLength);
win.add(txt);
win.add(button);
win.open();
2. Check log, make sure maxLength is -1
3. Click on button
4. Start typing, the content should not exceed 10 characters.
5. Re-run code, this time enter 20+ characters before click on button
Pull pending https://github.com/appcelerator/titanium_mobile/pull/2670
Pull merged.
Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.2.0.v20120813184911 Devices: iPhone 4s 5.0.1 iPad1 5.1.1 Simulator 5.1 Mac osx 10.8 Mountain Lion
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876