Skip to content

Commit

Permalink
fix(QInput): fix extra space on bottom of autogrow QInput on large te…
Browse files Browse the repository at this point in the history
…xts on one line #13196 (#13237)
  • Loading branch information
pdanpdan committed Apr 23, 2022
1 parent 90a7588 commit 5e15fde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/src/components/input/QInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,16 @@ export default createComponent({
const inp = inputRef.value
if (inp !== null) {
const parentStyle = inp.parentNode.style
const { overflow } = inp.style

// reset height of textarea to a small size to detect the real height
// but keep the total control size the same
parentStyle.marginBottom = (inp.scrollHeight - 1) + 'px'
inp.style.height = '1px'
inp.style.overflow = 'hidden'

inp.style.height = inp.scrollHeight + 'px'
inp.style.overflow = overflow
parentStyle.marginBottom = ''
}
}
Expand Down

0 comments on commit 5e15fde

Please sign in to comment.