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
  • Loading branch information
pdanpdan committed Apr 22, 2022
1 parent 9bdb052 commit c423345
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/src/components/input/QInput.js
Expand Up @@ -285,13 +285,16 @@ export default Vue.extend({
const inp = this.$refs.input
if (inp !== void 0) {
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 c423345

Please sign in to comment.