Merge pull request #4174 from cyberalien/ticket/14467

[ticket/14467] Fix height calculation in autoResize
This commit is contained in:
Marc Alexander 2016-02-09 16:57:25 +01:00
commit ad5d4f6bc3

View file

@ -1029,7 +1029,7 @@ phpbb.resizeTextArea = function($items, options) {
function autoResize(item) { function autoResize(item) {
function setHeight(height) { function setHeight(height) {
height += parseInt($item.css('height'), 10) - $item.height(); height += parseInt($item.css('height'), 10) - $item.innerHeight();
$item $item
.css({ height: height + 'px', resize: 'none' }) .css({ height: height + 'px', resize: 'none' })
.addClass('auto-resized'); .addClass('auto-resized');
@ -1048,7 +1048,7 @@ phpbb.resizeTextArea = function($items, options) {
configuration.maxHeight configuration.maxHeight
), ),
$item = $(item), $item = $(item),
height = parseInt($item.height(), 10), height = parseInt($item.innerHeight(), 10),
scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0; scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
if (height < 0) { if (height < 0) {