[TIMOB-27169] iOS 13: Prevent modal windows from being swiped down
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-08-30T10:23:02.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.2.0 |
| Components | iOS |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Vijay Singh |
| Created | 2019-06-19T17:38:04.000+0000 |
| Updated | 2020-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
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(); });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();I gave this PR a try and it seemed to work fine for me in the simulator.
Works great! The
closeevent as well. Good work!FR Passed on 8_2_X. Waiting on Jenkins builds.
Merged to master (8.2.0)
*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