Skip to content

Commit

Permalink
Fix iOS scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKvazos committed Feb 21, 2018
1 parent 95c6741 commit af769ef
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ const renderiFrame = (props) =>{
if (currentIframe) {
currentIframe.remove();
}

let scrollable = window.document.getElementById('scrollable');
if (!scrollable && props.isIOS) {
window.document.body.appendChild((() => {
let div = document.createElement('div');
div.id = 'scrollable';
div.className = 'scrollable';
scrollable = div;
return div;
})());
}

window.document.body.appendChild((() => {
let p = window.document.createElement('p');
p.innerHTML = 'Loading...';
Expand All @@ -71,7 +83,9 @@ const renderiFrame = (props) =>{
return p;
})());

window.document.body.appendChild((() => {
let container = props.isIOS ? scrollable : window.document.body;

container.appendChild((() => {
let iFrame = window.document.createElement('iframe');
iFrame.id = 'webviewIframe';
iFrame.src = props.url;
Expand Down

0 comments on commit af769ef

Please sign in to comment.