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

add ref for sizer div for width queries #156

Closed ghost closed 5 years ago

ghost commented 5 years ago

I was doing some custom alignment with AutoSizeInput components and ran into problems when getting the clientWidth from the input ref. My problems were fixed by getting the client width of the sizer div instead, then using that for my alignment logic.

I got the dom element of the sizer manually like this: sizerDomElement = inputRef.parentElement.children.item(1)

This seems like a bad way to do this, is it feasible to be able to make a change to be able to get the ref via a sizerRef prop in the same way we can obtain the inputRef - through the inputRef prop.

designbyadrian commented 5 years ago

Why is this ticket closed? What was the solution?