Fix for use in modal windows

As well as making UX more smooth by hiding the intermediate window on iOS.