fix jumping inputbox's height

This commit is contained in:
Henry Jameson 2018-04-15 15:55:47 +03:00
parent 15a7151ade
commit 57e91bc783

View file

@ -239,14 +239,12 @@ const PostStatusForm = {
e.dataTransfer.dropEffect = 'copy' e.dataTransfer.dropEffect = 'copy'
}, },
resize (e) { resize (e) {
const target = e.target || e const vertPadding = window.getComputedStyle(e.target)['padding-top'] +
target.style.height = 'auto' window.getComputedStyle(e.target)['padding-bottom']
const heightPx = target.scrollHeight - 10 e.target.style.height = 'auto'
if (heightPx > 54) { e.target.style.height = `${e.target.scrollHeight - vertPadding}px`
target.style.height = `${target.scrollHeight - 10}px` if (e.target.value === '') {
} e.target.style.height = '16px'
if (target.value === '') {
target.style.height = '16px'
} }
}, },
clearError () { clearError () {