Issue Description
When the user scroll very fast some attributed strings are missing (See attached screenshots), this is not happening on normal labels and if you scroll back slowly the attributed strings are showed.
Steps to Reproduce
Create a new default alloy project
replace the views/index.xml with the next code:
<Alloy>
<Window class="container">
<ListView id="listView">
<Templates>
<ItemTemplate name="simpleLabel">
<Label bindId="label1" id="label1"/>
</ItemTemplate>
</Templates>
</ListView>
</Window>
</Alloy>
Replace the controllers/index.js code with the next code:
var listSection = Ti.UI.createListSection();
var dataItems = [];
for (var i = 0; i < 100; i++) {
var data = {
template: "simpleLabel",
label1: {},
};
if (i % 2 === 1) {
data.label1.attributedString = Ti.UI.createAttributedString({
text: "Italic row row row" + i,
attributes: [
{
type: Ti.UI.ATTRIBUTE_FONT,
value: {
fontWeight: "normal",
fontStyle: "italic",
},
range: [0, 6],
}
]
});
} else {
//data.label1.text = "Normal";
data.label1.text="Normal" + i;
}
dataItems.push(data);
};
listSection.setItems(dataItems);
$.listView.setSections([listSection]);
$.index.open();
Replace the code inside styles/index.tss with the next code:
".container": {
backgroundColor: "#fff",
layout: "vertical",
}
"#listView": {
height: Ti.UI.FILL,
width: Ti.UI.FILL,
}
"#label1": {
font: {
fontSize: 26,
},
color: "#000",
}
"Label": {
color: "#000",
font: {
fontSize: 30,
},
}
Run
Scroll fast and stop
I have also been able to recreate this by simply changing the device orientation.
master PR: https://github.com/appcelerator/titanium_mobile/pull/7895
PR reviewed and merged.
Verified the fix. Attributed strings don't disappear on fast scrolling & changing orientation. Closing. Environment: Appc Studio : 4.7.0.201606150733 Ti SDK : 5.4.0.v20160617074028 Ti CLI : 5.0.9 Alloy : 1.9.0 MAC El Capitan : 10.11.4 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-18 Node: 4.4.4 Nexus 6 - Android 6.0.1
[~lchoudhary] Can you please verify if this issue reappears in 7.5
[~spulipakkam], I can reproduce the issue with 7.5.0.GA. It appears to be a regression. I don't see it on 7.4.1.GA
Here's a simplified test case:
master: https://github.com/appcelerator/titanium_mobile/pull/10575
FR Passed, waiting on Jenkins build to merge.
Awesome! I'm facing this problem on my current version (7.5.1.RC). Is this fix on 7.5.1.v20190108052418 (version from 08 of January)? Thanks!
Nope, it does not work for this version. Working fine on 7.4.3.v20190108080441 but not working with 7.5.1.v20190108052418. Is this going to be merged into 7.5.1 before GA?
Please merge this on 7.5.1.GA, we have several new screens depending on this for production release!
7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10611
yay! Gonna run a couple of tests and let you know how is it looking. Cheers!
Closing ticket, Verified fix in SDK Version 8.1.0.v20190115054502 and SDK version 8.0.0.v20190114160512. Test and other information can be found at: 7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10611 8.0.0: https://github.com/appcelerator/titanium_mobile/pull/10575 Verified with the test case mentioned above by [~gmathews].
Also verified using SDK version
7.5.1.v20190115054254
Tested and everything looks fine! Thanks guys