From 9ff2ccf1ed6349a5d5ad1a819e0de90b96dd0102 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 26 Apr 2017 18:52:30 +0700 Subject: [PATCH] Safari IOS ignores width=100% in iframes --- client/coral-embed/src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/coral-embed/src/index.js b/client/coral-embed/src/index.js index 722f4ca8e..950fa91bc 100644 --- a/client/coral-embed/src/index.js +++ b/client/coral-embed/src/index.js @@ -57,6 +57,10 @@ function configurePymParent(pymParent) { window.document.body.appendChild(snackbar); + // Workaround: IOS Safari ignores `width` but respects `min-width` value. + pymParent.el.firstChild.style.width = '1px'; + pymParent.el.firstChild.style.minWidth = '100%'; + // Resize parent iframe height when child height changes pymParent.onMessage('height', function(height) { if (height !== cachedHeight) {