forked from srxl/akkoma-fe
fix jumping inputbox's height
This commit is contained in:
parent
15a7151ade
commit
57e91bc783
1 changed files with 6 additions and 8 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue