[TIMOB-23500] Android: Ti.UI.Label.ellipsize should default to TruncateAt.END, but is undefined
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-08-24T03:29:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | Android |
Labels | parity |
Reporter | Christopher Williams |
Assignee | Chee Kiat Ng |
Created | 2016-06-10T19:52:30.000+0000 |
Updated | 2016-08-29T22:18:14.000+0000 |
Description
According to docs, it should default to false.
it('ellipsize', function () {
var label = Ti.UI.createLabel({
text: 'this is some text'
});
should(label.ellipsize).be.a.Boolean; // undefined on Android
should(label.getEllipsize).be.a.Function;
should(label.ellipsize).eql(false);
should(label.getEllipsize()).eql(false);
label.ellipsize = true;
should(label.getEllipsize()).eql(true);
should(label.ellipsize).eql(true);
});
PR: https://github.com/appcelerator/titanium_mobile/pull/8094 I've put the default value to
false
since it is allowed to set it totrue
= TruncateAt.END andfalse
= null (default; turn off ellipsizing)Adding:
Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_NONE
Default:Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END
will output:
Is label1 truncate at end? true
Is label2 truncate at end? false
Default on top, _NONE at the bottom: !http://migaweb.de/ellipsize.png!PR is merged and this is fixed. But unit test need to be updated. PR coming for that.
PR here: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/2
Verified the fix. Closing. Environment: Appc Studio : 4.8.0.201608221113 Ti SDK : 6.0.0.v20160829005859 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.7 Appc CLI : 6.0.0-31 Node: 4.4.4 Nexus 6 - Android 6.0.1