Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15008

iOS: iPad Alert dialog does not consider window orientation modes

    Details

      Description

      Description

      We have modal window and a button. when user clicks on the button alert pops up.
      The app is supposed to have only portrait orientation which is set in tiApp.xml file.
      When alert pops up, the device supports orientation change.

      Testcase

      Step to reproduce:
      1.Tap on the button in the main window,which opens modal window.
      2.Tap on the button in modal window that brings up alert dialog.
      3.Try rotating the device and orientation is supported

       
      //app.js
      var win = Ti.UI.createWindow({
      backgroundColor : '#fff',
          
      orientationModes : [Ti.UI.PORTRAIT] //to be sure
      });
       
       
      var clickMeBtn = Ti.UI.createButton({
       
      title : 'Click to open modal window'
      });
       
      var cancelBtn = Ti.UI.createButton({
       
      title : 'cancel'
      });
       
      var modalWin = Ti.UI.createWindow({
      backgroundColor : '#bbb',
          
      modal : true,
          
      orientationModes : [Ti.UI.PORTRAIT] //to be extra double sure
      });
       
      var modalButton = Ti.UI.createButton({
      title : 'Click to test Orientation'
      });
      modalWin.add(modalButton); 
      modalWin.setLeftNavButton(cancelBtn);
       
      win.add(clickMeBtn);
        
       
      clickMeBtn.addEventListener('click',function(_event){
       
       modalWin.open();
       
      });
       
      modalButton.addEventListener('click', function(e) {
         var dialog = Ti.UI.createAlertDialog({
          message: 'Rotate device to see the orientaion change',
          ok: 'Okay',
          title: 'File Deleted'
        }).show(); 
      //alert('Rotate device to see the orientaion change');
      });
       
      cancelBtn.addEventListener('click', function(e){
      	modalWin.close();
      });
       
      win.open();
      

      In tiapp.xml

      <iphone>
              <orientations device="iphone">
                  <orientation>Ti.UI.PORTRAIT</orientation>
              </orientations>
              <orientations device="ipad">
                  <orientation>Ti.UI.PORTRAIT</orientation>
              </orientations>
      </iphone>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                srahim Sabil Rahim
                Reporter:
                rsharma Rupesh Sharma
              • Watchers:
                0 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-17311
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration