Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1728] 1.4.1 regression: Calling addEventListener on a buttonBar resets its styling

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-25T17:49:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsbuttonbar, event, ios
ReporterRobby
AssigneeNeeraj Gupta
Created2011-04-15T03:00:42.000+0000
Updated2012-07-26T22:20:05.000+0000

Description

This worked fine in 1.4.0 but broke in 1.4.1. Try the code below:

var win = Ti.UI.currentWindow;

var btn1 = Titanium.UI.createButtonBar({
    labels:["Test"],
    backgroundImage: 'none',
    backgroundColor:'#0d8d00',
    width:70,
});
btn1.addEventListener('click', function(e) {
    alert("foo");
});
win.rightNavButton = btn1;

Removing that addEventListener call fixes things.

Comments

  1. Stephen Tramer 2011-04-15

    Tested 1.6.0GM. Test in bugtests.

  2. Stephen Tramer 2012-07-25

    Cannot reproduce against SDK 2.2.0.014b86f on iPhone Sim 5.1. Test case:
       var win = Ti.UI.createWindow();
       var btn1 = Titanium.UI.createButtonBar({
           labels:["Test"],
           backgroundImage: 'none',
           backgroundColor:'#0d8d00',
           width:70,
       });
       btn1.addEventListener('click', function(e) {
           alert("foo");
       });
       win.rightNavButton = btn1;
       
       var tg = Ti.UI.createTabGroup();
       tg.addTab(Ti.UI.createTab({
           window:win
       }));
       tg.open();
       

JSON Source