[Text Field] multiline support doesn't work when the component is initially hidden and then revealed
Problem description
If the TextField is part of a div that is hidden (i.e. css - display: none), and then later revealed (i.e. css - display: block), the multiline support doesn't work until the user clicks on the component and edits the text. Then it behaves as normal. Issue is reproduced in the link below.
Link to minimal working code that reproduces the issue
https://www.webpackbin.com/bins/-KjpmVgfD30Ow7I01zlv
Versions
- Material-UI: 0.18
- React: 15.4.2
- Browser: Chrome
{
(this.state.hidden) ?
null :
<TextField
errorText=""
floatingLabelText="Some floating label"
floatingLabelFixed={true}
multiLine={true}
value = "ajhsdbhjasbdjhabsjhdbjas djhas djas jhd asjhd j"
/>
}
Try this.
Note, the webpackbin reference above was throwing an error when I visited it, I've reproduced the example here: https://www.webpackbin.com/bins/-Kmyb3oPuT3eEuA20grR
EDIT: More info: syncHeightWithShadow uses shadow.scrollHeight to ask the real hidden textarea what its height should be. Unfortunately, when wrapped in a div that has display: none, shadow.scrollHeight returns 0.
Just adding info because I'm facing a similar but unrelated issue and did some investigation.
We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it. Still, we will accept PR fixes until v1-beta takes over the master branch.