Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3060] iOS: Modal Window Animated False

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2018-08-03T08:37:46.000+0000
Affected Version/sRelease 2.1.0, Release 1.8.2, Release 2.0.1, Release 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelscore, reprod
ReporterPedro Enrique
AssigneeHans Knöchel
Created2011-04-15T03:35:49.000+0000
Updated2018-08-03T08:37:50.000+0000

Description

If a modal window is opened with animated:false, it will be opened without animation but will close with animation. Example code:
var win = Titanium.UI.createWindow({ backgroundColor:'#fff' });
var button = Ti.UI.createButton({title:'open', width:200, height:50});
win.add(button);
button.addEventListener('click', function(){
    var win2 = Ti.UI.createWindow({backgroundColor:'#ccc'});
    var button2 = Ti.UI.createButton({title:'close', width:200, height:50});
    win2.add(button2);
    button2.addEventListener('click', function(){
        win2.close();
        //win2.close({animted:false});
    });
    win2.open({modal:true, animated:false});
});
win.open();

Comments

  1. Federico Casali 2012-05-16

    Jira bug review - still reproducible with latest 2.1 CI
  2. Junaid Younus 2012-08-30

    Tested on the iOS simulator using TiSDK 2.2.0v20120830102513, issue still valid.
  3. Mark Anthony Sabandal 2013-01-23

    still valid from sdk 3.0.0ga
  4. Shameer Jan 2013-05-06

    Issue 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
  5. Lee Morris 2017-05-24

    Can still reproduce this with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705021158 Ti SDK 6.1.0.v20170519131839 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80
  6. Hans Knöchel 2018-08-03

    The bug is not valid, because the code was not valid. Developers should use the NavigationWindow to open modal windows since 3.x and pass animated: false to the close-call to disable it, since animations are natively enabled by default on iOS. Working code:
       var win = Titanium.UI.createWindow({ backgroundColor:'#fff' });
       var button = Ti.UI.createButton({title:'open', width:200, height:50});
       win.add(button);
       button.addEventListener('click', function(){
           var win2 = Ti.UI.createWindow({backgroundColor:'#ccc'});
           var nav = Ti.UI.iOS.createNavigationWindow({ window: win2 });
           var button2 = Ti.UI.createButton({title:'close', width:200, height:50});
       
           win2.add(button2);
           button2.addEventListener('click', function(){
               nav.close({ animated: false });
           });
           nav.open({modal:true, animated:false});
       });
       win.open();
       

JSON Source