Closed
Description
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
- Fix
onChange
like @deanmcpherson did in iOS Text - Modify "onChange" behaviour to allow for all changes in contentSize #6283 - "Add a separate
onContentSizeChange
event 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
- 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 inonContentSizeChange
? - who will implement this on iOS?
- do we back out of providing layout information in the
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
mangogogos commentedon Jun 14, 2016
Any update on this? Most of the relevant issues have gone quiet
bestander commentedon Jun 21, 2016
I posted internally to get some attention, sorry for the wait.
Meanwhile if this affects you and you want to raise visibility, create an entry in product pains
Implement TextInput onContentSizeChange
Implement TextInput onContentSizeChange
Implement TextInput onContentSizeChange
holyxiaoxin commentedon Sep 8, 2016
How is onContentSizeChange getting fired? I'm on Android and react-native v0.32.0, multiline is true. I only get onContentSizeChange fired for the first time, after that it doesn't fire even after i'm hitting the next line.
jayshah123 commentedon Sep 23, 2016
Checking on v0.33 rn on android, multiline is true.
I only get onContentSizeChange fired for the first time, after that it doesn't fire even after i'm hitting the next line.
oargaruna commentedon Sep 28, 2016
Issue reported by @jayshah123 and @holyxiaoxin still persists on v0.34. For now I am using both onChange and onContentSizeChange. The former for Android and the latter for iOS.
snowjade commentedon Oct 8, 2016
Oh ,I get the same issue too as reported by @jayshah123 and @holyxiaoxin
25 remaining items