Original discussion here: #1229 (comment)
Problem
the onChange event that we depend upon here only fires when a user enters text via a keyboard. This means that if there is more than one line of text loaded in (e.g. resuming a form), the height will be restricted to whatever the default is. Is there any way to trigger (or measure) the contentSize so that we can set an accurate initial height?
Potential solutions
Decision that needs to be made
- Do we push forward with
onContentSizeChange? (an aside, see our justification for naming).
- If yes:
- do we back out of providing layout information in the
onChange event from TextInput and just provide it in onContentSizeChange?
- who will implement this on iOS?
@nicklockwood @deanmcpherson @bestander
Original discussion here: #1229 (comment)
Problem
Potential solutions
onChangelike @deanmcpherson did in iOS Text - Modify "onChange" behaviour to allow for all changes in contentSize #6283onContentSizeChangeevent which can be observed independently of onTextChange." ([TextInput - Multiline] Reimplemented RCTTextView and added auto height scaling. #1229 (comment)) -- I did this for Android in this commit.Decision that needs to be made
onContentSizeChange? (an aside, see our justification for naming).onChangeevent from TextInput and just provide it inonContentSizeChange?@nicklockwood @deanmcpherson @bestander