[TIMOB-19764] previewContext does not work when set while modal window is open or closing
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | 3dtouch |
| Reporter | Fokke Zandbergen |
| Assignee | Unknown |
| Created | 2015-10-22T14:53:57.000+0000 |
| Updated | 2018-10-03T11:07:57.000+0000 |
Description
In the 3D Touch sample app we have to use a
setTimeout() of ~500ms to delay the rendering of the list (and as part of that setting the previewContext on each thumbnail) after finishing selecting a picture from the device's Photo Gallery. If we don't than Peek and Pop will not work.
This happens only with Camera, Photo Gallery or another modal window. If non-modal window is open while we set previewContext it does work.
Sample code: https://github.com/appcelerator-developer-relations/appc-sample-3dtouch/blob/master/app/controllers/list.js#L81
[~fokkezb] Does it only happen to those or also in other modal dialogs (e.g.
Ti.UI.iOS.NavigationWindow). Because I think, the cleanest (and closest way to the native implementation) would be, to have close events on the camera and photo gallery dialogs (as well as contact picker as far as I think), since they all areUIViewController's. And when we have this ones, we place the code inside the close event, to make the sure transitions do not overlay. I think thats the quickest, but the cleanest solution here.Or we could wait to call the callbacks until the UIViewControllers are closed. Yes, indeed the same is true when a regular modal window is open while the previewcontext is set. If it's a regular window it does work.
Just what i thought of, because the modal transition takes longer. So a) fire the "success" callback after the view controllers are closed or b) provide a "close" callback instead. No rush here, let's compare the pros and cons.