[TIMOB-16511] iOS: Text in label gets truncated (...) when changing fontWeight from normal to bold
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-08-24T17:19:33.000+0000 |
Affected Version/s | Release 3.2.1 |
Fix Version/s | Release 7.5.0 |
Components | iOS |
Labels | ios, merge-7.0.2 |
Reporter | Michael Woode |
Assignee | Vijay Singh |
Created | 2014-02-25T10:04:54.000+0000 |
Updated | 2018-08-24T17:19:38.000+0000 |
Description
If setting either the width or left and right values of a label the text will be truncated when you change the fontWeight of the label. If width or left and right are omitted it resizes the label correctly after changing the fontWeight.
The label container is "showing" the right size, but text gets truncated anyway.
var testLbl = Ti.UI.createLabel({
text: 'Some semi-long text',
font: {
fontWeight: 'normal',
fontSize: 13
},
backgroundColor:'#f00',
color: '#000',
textAlign: 'center',
top: 60,
// left: 10,
// right: 10,
width:'90%'
});
setTimeout(function(e){
testLbl.font = {
fontWeight: 'bold',
fontSize: 13
};
//text gets truncated
}, 1000);
I believe it has more to do with changing the fontWeight dynamically from "normal" to "bold". If you set the fontWeight to Bold initially and then change it to Bold dynamically then also it works fine. So it appears that the size is being not calculated when the fontWeight changes.
Moving this ticket to engineering as I can reproduce this issue with the following test case.
Issue reproduces on SDK Version 3.2.1 and 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.2.1.GA Titanium SDK version 3.4.0.GA Appcelerator Studio, build: 3.3.0.201407111535 iOS SDK: 7 iOS iPhone Simulator: 7
This bug is triggered event if I set de fontFamily by its current value : $.label.font.fontFamily = $.label.font.fontFamily
PR - https://github.com/appcelerator/titanium_mobile/pull/9923
*Closing ticket*, Verified fix in SDK Version:
7.4.0.v20180717131401
*FR Passed (Test Steps):*Created a titanium application
Added the following code above in the
app.js
Ran the application
Application text no longer truncated when changing the 'fontWeight' to bold from normal
*Test Environment*