Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10222] iOS: Implement maxLength for TextArea

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-07T14:30:26.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-16 API, Release 3.0.0
ComponentsiOS
Labelsapi, module_textarea, parity, qe-review, qe-testadded
ReporterHieu Pham
AssigneeVishal Duggal
Created2012-07-27T15:23:34.000+0000
Updated2014-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

Comments

  1. Vishal Duggal 2012-08-02

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2670
  2. Blain Hamon 2012-08-07

    Pull merged.
  3. Olga Romero 2012-08-14

    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
  4. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876

JSON Source