From 8729783dc5cdba685425ec6f2c7aa51794f53db8 Mon Sep 17 00:00:00 2001 From: Jack Moore Date: Sat, 26 Sep 2015 17:59:37 -0400 Subject: [PATCH] fixed reflowing of initial text for Chrome and Safari. --- src/autosize.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/autosize.js b/src/autosize.js index 41ce6db..b42cfa7 100644 --- a/src/autosize.js +++ b/src/autosize.js @@ -18,12 +18,14 @@ function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) { if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return; let heightOffset = null; - let overflowY = 'hidden'; + let overflowY = null; let clientWidth = ta.clientWidth; function init() { const style = window.getComputedStyle(ta, null); + overflowY = style.overflowY; + if (style.resize === 'vertical') { ta.style.resize = 'none'; } else if (style.resize === 'both') { @@ -153,9 +155,6 @@ function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) { ta.addEventListener('autosize:update', update); set.add(ta); - if (setOverflowY) { - ta.style.overflowY = 'hidden'; - } if (setOverflowX) { ta.style.overflowX = 'hidden'; ta.style.wordWrap = 'break-word';