ionic-gallery-modal
ionic-gallery-modal copied to clipboard
Wrong postitioning after orientation change iOS 11
After changing the orientation when the modal is present, the image gots a wrong position.
See this screenshot: @https://imgur.com/a/CmFzB
same in android.
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.
Anyone found the solution. Facing the same problem on android devices.