Fix a bug breaking textarea on Android

This commit is contained in:
Jérémie Astori 2016-07-15 02:42:47 -04:00
parent 7d627e379d
commit 27b33f49a8
2 changed files with 6 additions and 2 deletions

View file

@ -1263,6 +1263,7 @@ button {
background: transparent;
border: none;
font: inherit;
min-height: 18px; /* Required when computing input height at char deletion */
height: 18px;
max-height: 90px;
line-height: 1.5;

View file

@ -632,8 +632,11 @@ $(function() {
.history()
.on("input keyup", function() {
var style = window.getComputedStyle(this);
this.style.height = "0px";
this.offsetHeight; // force reflow
// Start by resetting height before computing as scrollHeight does not
// decrease when deleting characters
this.style.height = this.style.minHeight;
this.style.height = Math.min(
Math.round(window.innerHeight - 100), // prevent overflow
this.scrollHeight