Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11669] iOS: Label - postlayout events fired twice for labels.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-26T08:33:46.000+0000
Affected Version/sRelease 2.1.4
Fix Version/s2013 Sprint 07
ComponentsiOS
Labelsparity, qe-ios214
ReporterOlga Romero
AssigneeShameer Jan
Created2012-11-05T21:33:48.000+0000
Updated2014-06-19T12:44:22.000+0000

Description

While testing Labels I noticed that console fires events twice. *not a regression* occurs on 2.1.3 It also appears in 3.0.0 Test steps: 1.Run this code below:
var win = Ti.UI.createWindow({
    backgroundColor : '#FFF',
    layout : 'vertical'
});
 
var label = Ti.UI.createLabel({
    text : "hello",
    left : 0,
    width : Ti.UI.SIZE,
    height : Ti.UI.SIZE
});
 
label.addEventListener("postlayout", function(e) {
    Ti.API.info("label postlayout");
    //alert("label post layout");
});
 
var doBtn = Ti.UI.createButton({
    title : "do",
    width : Ti.UI.SIZE,
    height : Ti.UI.SIZE
});
 
doBtn.addEventListener("click", function() {
    label.text = "new text";
    label.backgroundColor = '#F00';
    label.left += 20;
 
});
win.add(doBtn);
win.add(label);
win.open(); 
2. Press buttons in order 3. Check console Actual result: 3.See an attachment. Expected result: See an attachment.

Attachments

FileDateSize
eventsX2.txt2012-11-05T21:33:48.000+00001511
expected.txt2012-11-05T21:33:48.000+0000539

Comments

  1. Shameer Jan 2013-03-26

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Olga Romero 2013-03-26

    Tested with: Titanium Studio, build: 3.1.0.201303230404 Titanium SDK, build: 3.1.0.v20130325155928 Devices: iPhone5 iOS 6.1.3 iPad mini iOS 6.0 "label postlayout" fired once
  3. Anshu Mittal 2013-04-10

    Tested with: SDK: 3.1.0.v20130409124549 Studio:3.1.0.201304011603 Device: iPad2(v 5.1) OS: OSX 10.7.5 "label postlayout' fires once.

JSON Source