Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27169] iOS 13: Prevent modal windows from being swiped down

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-08-30T10:23:02.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.2.0
ComponentsiOS
Labelsn/a
ReporterHans Knöchel
AssigneeVijay Singh
Created2019-06-19T17:38:04.000+0000
Updated2020-11-24T07:35:26.000+0000

Description

iOS 13 will display modal windows as page sheets by default. To prevent this for certain screens, the isModalInPresentation property can be configured on the internal view controller. This should be exposed as a forceModal boolean property. Since Android does not support this so far, it'd be an iOS only property for now, but could be extended once Android supports it as well. https://developer.apple.com/documentation/uikit/uiviewcontroller/3229894-modalinpresentation

Comments

  1. Vijay Singh 2019-07-17

    PR - https://github.com/appcelerator/titanium_mobile/pull/11057 Test Case -
       var window1 = Ti.UI.createWindow({
           title: "Modal Window",
           backgroundColor: 'white'
       });
       
       var win = Ti.UI.createNavigationWindow({
           window: window1
       });
       
       var button1 = Ti.UI.createButton({
           title: 'Open Window'
       });
       
       window1.add(button1);
       
       win.open();
       
       var window2 = Ti.UI.createWindow({
           backgroundColor: 'blue'
       });
       
       var button2 = Ti.UI.createButton({
           title: 'Close Window'
       });
       
       window2.add(button2);
       
       button1.addEventListener('click', function(e){
         window2.open({
           modal:true,
           forceModal: true,
         });
       });
       
       button2.addEventListener('click', function(e){
         window2.close();
       });
       
  2. Vijay Singh 2019-08-21

    Test Case for close event from TIMOB-27332 -
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
        
       var btn = Ti.UI.createButton({
           title: 'Trigger'
       });
        
       var winClose = Ti.UI.createButton({
           title: 'Close'
       });
        
       btn.addEventListener('click', function() {
           var win2 = Ti.UI.createWindow({ backgroundColor: 'white' });
        
           win2.addEventListener('close', () => {
               Ti.API.warn('CLOSED')
           });
        
           var nav = Ti.UI.createNavigationWindow({
               window: win2
           });
          
           nav.add(winClose);
        
           nav.addEventListener('open', () => {
               Ti.API.warn('OPENED')
           });
        
           nav.open({ modal: true })
        
           winClose.addEventListener('click', () => {
               nav.close()
           });
        
       });
        
       win.add(btn);
       win.open();
       
  3. Donovan Lewis 2019-08-21

    I gave this PR a try and it seemed to work fine for me in the simulator.
  4. Hans Knöchel 2019-08-27

    Works great! The close event as well. Good work!
  5. Samir Mohammed 2019-08-29

    FR Passed on 8_2_X. Waiting on Jenkins builds.
  6. Christopher Williams 2019-08-29

    Merged to master (8.2.0)
  7. Samir Mohammed 2019-08-30

    *Closing ticket*, improvement verified in SDK version 8.2.0.v20190829124255. Note* Improvement will be merged into 8_3_X at a later date. Test and other information can be found at: PR - https://github.com/appcelerator/titanium_mobile/pull/11057

JSON Source