nikini / ionic-gallery-modal

Ionic Gallery Modal (to show all your photos)
166 stars 84 forks source link

Wrong postitioning after orientation change iOS 11 #54

Open w3development-kn opened 6 years ago

w3development-kn commented 6 years ago

After changing the orientation when the modal is present, the image gots a wrong position.

See this screenshot: @https://imgur.com/a/CmFzB

ykokam2 commented 6 years ago

same in android.

anshnirmal commented 5 years ago

A dirty fix for the issue. I have done this for my android application. Change the time delay from 550 to 1550 worked for me.

File: node_modules\ionic-gallery-modal\index.js Line number: 472

GalleryModal.prototype.orientationChange = function (event) { var _this = this; // TODO: See if you can remove timeout window.setTimeout(function () { _this.resize(event); }, 1550); };

The updated width and height was not available with a delay of 550 millisecond. It taking a bit time to update orientation change device width and height. Increasing the window.setimeout delay fixed.

I hope the actual implementation should be a listener that should call "resize" event once there is a change applied in device width and height.

NareshKukreti12 commented 4 years ago

Anyone found the solution. Facing the same problem on android devices.