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:
Henry Jameson 2018-12-20 07:19:42 +03:00
commit 9306a879cb

View file

@ -297,6 +297,8 @@ const PostStatusForm = {
if (!(target instanceof window.Element)) { return }
const vertPadding = Number(window.getComputedStyle(target)['padding-top'].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`
if (target.value === '') {
target.style.height = undefined