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'
},
resize (e) {
const target = e.target || e
target.style.height = 'auto'
const heightPx = target.scrollHeight - 10
if (heightPx > 54) {
target.style.height = `${target.scrollHeight - 10}px`
}
if (target.value === '') {
target.style.height = '16px'
const vertPadding = window.getComputedStyle(e.target)['padding-top'] +
window.getComputedStyle(e.target)['padding-bottom']
e.target.style.height = 'auto'
e.target.style.height = `${e.target.scrollHeight - vertPadding}px`
if (e.target.value === '') {
e.target.style.height = '16px'
}
},
clearError () {