JedWatson / react-input-autosize

Auto-resizing input field for React
https://jedwatson.github.io/react-input-autosize
MIT License
769 stars 178 forks source link

Styles from input not being copied to hidden div #99

Closed mvf4z7 closed 7 years ago

mvf4z7 commented 7 years ago

I noticed that font related styles from the visible input were not being properly copied to the hidden div used for calculating the size. This was causing the size of the input to be incorrect (too large), as the font-size of the div was larger than that of the input.

After changing this line to return when the compoennt is NOT mounted it seemed to fix the issue

e.g. if (!this.mounted || !window.getComputedStyle) {

slavab89 commented 7 years ago

Someone already opened the exact same PR https://github.com/JedWatson/react-input-autosize/pull/91 😄 We're still waiting for it to get merged

JedWatson commented 7 years ago

Should be fixed as of 1.2.0