Merge branch 'fix_textfields' into shigusegubu
* fix_textfields: I suppose SOME browsers don't do this by default... Fix resize not working properly for textareas
This commit is contained in:
commit
9306a879cb
1 changed files with 2 additions and 0 deletions
|
|
@ -297,6 +297,8 @@ const PostStatusForm = {
|
||||||
if (!(target instanceof window.Element)) { return }
|
if (!(target instanceof window.Element)) { return }
|
||||||
const vertPadding = Number(window.getComputedStyle(target)['padding-top'].substr(0, 1)) +
|
const vertPadding = Number(window.getComputedStyle(target)['padding-top'].substr(0, 1)) +
|
||||||
Number(window.getComputedStyle(target)['padding-bottom'].substr(0, 1))
|
Number(window.getComputedStyle(target)['padding-bottom'].substr(0, 1))
|
||||||
|
// Auto is needed to make textbox shrink when removing lines
|
||||||
|
target.style.height = 'auto'
|
||||||
target.style.height = `${target.scrollHeight - vertPadding}px`
|
target.style.height = `${target.scrollHeight - vertPadding}px`
|
||||||
if (target.value === '') {
|
if (target.value === '') {
|
||||||
target.style.height = undefined
|
target.style.height = undefined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue