Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27480] iOS : Setting last index of TabbedBar after initialization doesn't work

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-11-12T22:10:09.000+0000
Affected Version/sRelease 8.2.1, Release 8.2.0
Fix Version/sRelease 8.3.0
ComponentsiOS
LabelsengTriage, ios, tabbedbar
Reporternicolomonili
AssigneeVijay Singh
Created2019-10-17T09:27:32.000+0000
Updated2019-11-12T22:10:09.000+0000

Description

Test with SDK *8.2.0.GA* on iPhone SE Simulator (*iOS 12.2* , *iOS 13.1*) *Code test*
var win = Ti.UI.createWindow();

var labels = ['1', '2', '3', 'LAST'];
var TabbedbBar = Ti.UI.createTabbedBar({
    labels : labels
});

win.add(TabbedbBar);
win.open();

setTimeout(function(){
    TabbedbBar.index = labels.length - 1;
}, 2000);
This code work on iOS 12.2 simulator. This code doesn't work on iOS 13.1 simulator.

Attachments

FileDateSize
ios12-2.png2019-10-17T09:26:51.000+00005771
ios13-1.png2019-10-17T09:26:51.000+00006120

Comments

  1. Rene Pot 2019-10-17

    Tested it and can reproduce on 8.2.1.v20191009074714. It looks like it does get selected, however, it does not get redrawn properly. Because when you click another item after the selection animation does happen properly.
  2. Vijay Singh 2019-10-17

    This problem is in native app as well. Apple need to fix it. Until apple fixes it following changes will fix the issue- PR - https://github.com/appcelerator/titanium_mobile/pull/11288
  3. nicolomonili 2019-10-22

    Is there no possibility to temporarily insert this fix into a "continuous integrations builds" ?
  4. Vijay Singh 2019-10-23

    [~nicolomonili] This ticket is in review. Once PR get approved it'll get merged and you can get build. Meanwhile you can make the changes in your SDK as this is minor change.
  5. nicolomonili 2019-10-23

    Usually i don't like to change the SDK manually ... in this case i can do a test being a simple change
  6. nicolomonili 2019-10-23

  7. nicolomonili 2019-10-23

    I tried to manually edit the file *iphone/Classes/TiUIButtonBar.m*. The fix doesn't work. Do i have to do anything other than edit that file?
  8. Satyam Sekhri 2019-10-28

    FR Passed. Last index of TabbedBar gets set when done after initialization. Waiting for Jenkins build to pass before merge.
  9. Christopher Williams 2019-10-30

    merged to master
  10. Satyam Sekhri 2019-10-30

    Verified on: Mac OS: 10.14.5 SDK: 8.3.0.v20191030085531 Appc CLI: 7.1.1 JDK: 1.8.0_162 Node: 10.5.0 Studio: 5.1.4.201909061933 Xcode: 11.1 Device: iPhone X(v13.0), iPhone 7Plus(v12.3.1), iOS simulator 13.1, 12.2
  11. nicolomonili 2019-11-01

    In my situation the problem has not been solved. And I found the reason. Test code
        var win = Ti.UI.createWindow();
        var labels1 = ['1', '2', '3', 'LAST'];
        var labels2 = ['1', '2', '3', '4','5','LAST'];
        var TabbedbBar1 = Ti.UI.createTabbedBar({
            labels : labels1,
            top : 30
        });
        var TabbedbBar2 = Ti.UI.createTabbedBar({
            labels : labels2,
            top : 80
        });
        setTimeout(function(){
            
            TabbedbBar1.labels = labels1;   //try to remove this comment
            
            TabbedbBar1.index = labels1.length - 1;
            TabbedbBar2.index = labels2.length - 1;
        }, 2000);
        win.add(TabbedbBar1,TabbedbBar2);
        win.open();
        
  12. nicolomonili 2019-11-01

    In my case i have to update the labels value in some cases, and i noticed that doing this (at least the first time) creates problems with the index set.
  13. Rene Pot 2019-11-01

    I can confirm above code breaks the TabbedBar. For some reason, updating TabbedBar1 breaks TabbedBar2 index setting for me (using CLI 7.1.1/SDK 8.3.0.v20191030085531) When removing the line that says "try to remove this comment" both will work fine for me.
  14. Vijay Singh 2019-11-11

    PR (master) - https://github.com/appcelerator/titanium_mobile/pull/11324 PR (8_3_X) - https://github.com/appcelerator/titanium_mobile/pull/11325
  15. Satyam Sekhri 2019-11-12

    FR Passed. Waiting for Jenkins build to pass.
  16. Christopher Williams 2019-11-12

    merged to master, 8_3_X
  17. Satyam Sekhri 2019-11-12

    Verified on: Mac OS: 10.14.5 SDK: 8.3.0.v20191112112455, 9.0.0.v20191112112437 Appc CLI: 7.1.1 JDK: 1.8.0_162 Node: 10.5.0 Studio: 5.1.4.201909061933 Xcode: 11.2 Device: iPhone X(v13.2), iPhone 7Plus(v12.3.1), iOS simulator 13.2, 12.4

JSON Source