Don't scroll when mobile keyboard is selected (#105)

This commit is contained in:
copy 2016-11-22 16:44:44 +01:00
parent c7e96d745a
commit fee07cc8b3
2 changed files with 8 additions and 1 deletions

View file

@ -1103,7 +1103,13 @@
// allow text selection
if(window.getSelection().isCollapsed)
{
document.getElementsByClassName("phone_keyboard")[0].focus();
let phone_keyboard = document.getElementsByClassName("phone_keyboard")[0];
// stop mobile browser from scrolling into view when the keyboard is shown
phone_keyboard.style.top = document.body.scrollTop + 100 + "px";
phone_keyboard.style.left = document.body.scrollLeft + 100 + "px";
phone_keyboard.focus();
}
}
};

View file

@ -64,6 +64,7 @@ a {
resize: none;
border: 0;
padding: 0;
position: absolute;
}
h4 {
margin: 0px 0px 20px 0px;