Permalink
Browse files

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

  • Loading branch information...
1 parent c7e96d7 commit fee07cc8b33dc41df3eb8751558efc1fbf920170 @copy committed Nov 22, 2016
Showing with 8 additions and 1 deletion.
  1. +7 −1 src/browser/main.js
  2. +1 −0 v86.css
View
@@ -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
@@ -64,6 +64,7 @@ a {
resize: none;
border: 0;
padding: 0;
+ position: absolute;
}
h4 {
margin: 0px 0px 20px 0px;

0 comments on commit fee07cc

Please sign in to comment.