From 506de13896843890e0fa889c54909ac04a41fac9 Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Tue, 18 Jun 2019 08:25:29 +0200 Subject: [PATCH] FIX: remove temporary hack for fixed iOS bug (#7773) A bug where input focus is displaced on modals was fixed in iOS 11.3 update. This hack was causing problems on topic page since hiding main-outlet results in lost read position after opening and closing a modal. --- .../discourse/lib/show-modal.js.es6 | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/show-modal.js.es6 b/app/assets/javascripts/discourse/lib/show-modal.js.es6 index 3fa2b31fc11..f422a6273b3 100644 --- a/app/assets/javascripts/discourse/lib/show-modal.js.es6 +++ b/app/assets/javascripts/discourse/lib/show-modal.js.es6 @@ -4,33 +4,6 @@ export default function(name, opts) { opts = opts || {}; const container = Discourse.__container__; - // iOS 11 -> 11.1 have broken INPUTs on position fixed - // if for any reason there is a body higher than 100% behind them. - // What happens is that when INPUTs gets focus they shift the body - // which ends up moving the cursor to an invisible spot - // this makes the login experience on iOS painful, user thinks it is broken. - // - // Also, very little value in showing main outlet and header on iOS - // anyway, so just hide it. - if (isAppleDevice()) { - let pos = $(window).scrollTop(); - $(window) - .off("show.bs.modal.ios-hacks") - .on("show.bs.modal.ios-hacks", () => { - $("#main-outlet, header").hide(); - }); - - $(window) - .off("hide.bs.modal.ios-hacks") - .on("hide.bs.modal.ios-hacks", () => { - $("#main-outlet, header").show(); - $(window).scrollTop(pos); - - $(window).off("hide.bs.modal.ios-hacks"); - $(window).off("show.bs.modal.ios-hacks"); - }); - } - // We use the container here because modals are like singletons // in Discourse. Only one can be shown with a particular state. const route = container.lookup("route:application");