Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8979] iOS: Ti.Media.openPhotoGallery's cancel event doesn't trigger on iPad

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-10T10:59:48.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.0.2, Release 2.1.0, Sprint 2012-10 API
ComponentsiOS
LabelsSupportTeam, api, module_media, qe-testadded
ReporterVarun Joshi
AssigneeSabil Rahim
Created2012-05-03T15:23:41.000+0000
Updated2012-07-11T13:27:20.000+0000

Description

Code

{noformat} var win = Titanium.UI.createWindow({ backgroundColor:'white' }); win.open(); var imageView = Titanium.UI.createImageView({ height:200, width:200, top:20, left:10, backgroundColor:'#999' }); win.add(imageView); var popoverView; var arrowDirection; if (Titanium.Platform.osname == 'ipad') { // photogallery displays in a popover on the ipad and we // want to make it relative to our image with a left arrow arrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT; popoverView = imageView; } Titanium.Media.openPhotoGallery({ success:function(event) { var cropRect = event.cropRect; var image = event.media; // set image view Ti.API.debug('Our type was: '+event.mediaType); if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) { imageView.image = image; } else { // is this necessary? } Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width); }, cancel:function() { alert('cancelled fired'); }, error:function(error) { }, allowEditing:true, popoverView:popoverView, arrowDirection:arrowDirection, mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO] }); {noformat}

Expected Behavior

The alert in cancel event should get fired.

Actual Behavior

This does not work on the iPad simulator but works fine on iPhone simulator

Comments

  1. Sabil Rahim 2012-05-08

    [Pull pending](https://github.com/appcelerator/titanium_mobile/pull/2149)
  2. Natalie Huynh 2012-05-15

    Tested with 2.0.2.v20120515140151 on iPad 3 5.1.1

JSON Source